Hi,
I Just started programming C last week using Beginnning C++ programming which I must say is excellent. I have a basic grounding in PHP and did some Java in college so am moving through the book at quite a pace but im stuck on one of the exercise questions on Vectors,iterators and the erase member function so I joined up here to ask what will probably be the first of many questions and her e it is:
Im trying to match user input against a string object contained in a vector and erase that object but I get compile errors. Can anyone put me right? Heres the relevant code snippit....
Code:for(myIterator = games.begin(); myIterator < games.end(); ++myIterator) temp = *myIterator; if (gameEntered == temp) games.erase(myIterator); cout << "Game removed.\n\n" << endl; else out << "No match.\n\n" << endl;



LinkBack URL
About LinkBacks



CornedBee
, I only did it to a basic level and that was 3 years ago now. With the curly brackets I am following the book syntax and they dont use curlys very much at all. I use them all the time in PHP and didnt know you could get away without them, the C book im using says they are unessicary and its all to do with scope. I gotta say I dont fully understand this but im just following how they do it. Any comments on this?