help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

STL iterator question


From: Christian Christmann
Subject: STL iterator question
Date: Sat, 26 Mar 2005 18:37:08 +0100

Hi,

my program contains a class with a STL vector std::vector<int> data and an
integer variable "currentbit" which indicates the current position while
traversing the vector.

In my function first() I'm searching for a particular value and save the
position in "currentbit". Within another function next() I'd like to
continue searching beginning in the vector at position "currentbit". My
idea was to create an iterator:

vector<int>::const_iterator iter = *data[currentbit+1]

but the compiler complains:

 invalid type argument of `unary *'

What's wrong? How can I assing an iterator to a particular position in the
vector?

Thanks
Chris


reply via email to

[Prev in Thread] Current Thread [Next in Thread]