| |
| | |
| Join The Cult | Tweakers | Image Gallery | Donate | Search | Today's Posts | Mark Forums Read | |
Welcome to Tweak3DThis is an open forum about hardware and tech stuff. Sign-up here to join the discussion. |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | programming ? - c++ | permalink #1 |
| jive turkey | sorry to do this, i just realized i had left part of a project out i have due tomorrow, and this thing is giving me fits. compiler error message doesnt help either. whats wrong with it? palindrome is a class, works fine for everything else. << is overloaded, works fine if i use a constant vs an interator. size_type throws an error too. all the variables and stuff are defined right, its something with i and the vector::iterator shindig in the use of at(i). thanks Code: for (vector<palindrome>::iterator i = pVector.begin(); i < pVector.end(); i++) {
cout << pVector.at(i);
} | |
| Truth! Hope! Change! Generalities! Policies? Stupidity. Obama 08. | ||
| | | |
| | #2 |
| | |
| | |
| | permalink #2 | |
| I Am The Black Wizards | Using a class? Write a function within it to display the information rather than trying to cout it every time. Example: Code: for (vector<palindrome>::iterator i = pVector.begin(); i < pVector.end(); i++) {
pVector.print(i);
} | |
| | ||
| | | |
| | permalink #3 | |
| Globe Trekker | I know jack shit about programming. In 7th grade I took a programming class at a local college and made a command decision - I'm not well suited to sitting and pounding out code all day. Hence I do hardware, networking, and project management. | |
| | ||
| | | |
| | permalink #4 | |
| Has Absolutely no life | ^We Ryans stick together. | |
| Driving the bus to hell since 1984. | ||
| | | |
| | permalink #5 | ||
| jive turkey | Quote:
and i would imagine using << would be more proper than .print() | ||
| | | ||
| | permalink #6 | |
| I Am The Black Wizards | OOH, I get what you're doing now. You can probably find how to do it using some code I wrote a while back: http://thadood.ath.cx/9.cpp Let me know if it helps. | |
| | | |
| | permalink #7 | |
| jive turkey | lol thats not the problem. << IS overloaded properly. I can call it on specific elements and it works fine. the problem is with the iterators. if i replace .at(i) with .at(x) with x being any integer, it works fine. im screwing up with the iterator somehow... | |
| | | |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Web Programming and Design Links | tweakmonkey | Tech | 1 | 01-27-2008 10:46 AM |
| TI Calculator Programming, Ahh the Memories | Torx | Off-Topic | 11 | 07-24-2006 05:44 PM |
| Resume Help needed Please!!!!! | Alpha | Off-Topic | 8 | 06-06-2006 05:16 PM |
| Supercars video, Programming | tweakmonkey | Status and Feedback | 0 | 04-22-2006 05:49 PM |
| programming 8.0 UHF pro remote | MatTMaN | Off-Topic | 6 | 03-06-2006 07:58 PM |