|
From: <ri...@te...> - 2003-04-08 00:45:24
|
David McKen wrote: >This may sound really stupid but here goes. > >I have a vector of objects (STL vector, just an arbritary >class). I have just pushed an object onto the end of this >vector. I want the index (the number I put in [] to access >the object) of the object I pushed onto the back. How would >I do so? (vector.size()?, or .end()) > vector.end() returns the object contained in the last position of vector.= If you want the index, you should use vector.size()-1 --=20 Ricardo Amores Hern=E1ndez ricky (at) telecable (dot) es |