Vector Iterators

Started by
1 comment, last by Rendman 18 years, 6 months ago
Is there any way to get a vector iterator to point to any random element in a vector? example: vector<DataType> DataVector; vector<DataType>::iterator DataVectorIter; DataVectorIter[SomeArbitraryElement]; DataVector.erase(SomeArbitraryElement); thanks
Advertisement
int i = some_number;DataVectorIter = DataVector.begin() + i;DataVector.erase(DataVectorIter);
LOL, okay. I figured there would have been a single liner way to do that, ok thanks, SiCrane. I appreciate it.

This topic is closed to new replies.

Advertisement