(WinXp, Borland C++ Free command line)
Ok, its come time I need to delete a nullified part of my vector.
Heres my code summed up:
But my compiler doesnt like this at all.Code:int main() { vector <int> X; x.push_back(1); x.push_back(2); x[1]=0; x.erase(x[1]) }
I did a google search for this, and something about iterators or something poped up, but how do I return an iterator thats not the absolute beggining or absolute end of a vector? In this example it could work, but in my real code rend and rbegin wont work.Code:Warning W8012 C:\PlatformClass.h 141: Comparing signed and unsigned values in function Platform::Fall() Error E2285 C:\MOPEngine.h 168: Could not find a match for 'vector<Platform,allocator<Platform> >::erase(Platform)' in function PlatBreaker() *** 1 errors in Compile *** C:\Borland\BCC55\Bin>
So, how do I make this happy by giving it an iterator (that is what it wants right?)



LinkBack URL
About LinkBacks


