STL iterator
-
Need to know if I can directly access elements in an STL array based on the Iterator .. As for eg List contains { 1,2,3,4,5,6,7,8 } if List::Iterator iter = List.begin() Now to access nth element can the routine be like int GetElementAt( int index) { // range check iter = List.begin(); iter+=index; return *iter ; }
Engineering is the effort !
-
Need to know if I can directly access elements in an STL array based on the Iterator .. As for eg List contains { 1,2,3,4,5,6,7,8 } if List::Iterator iter = List.begin() Now to access nth element can the routine be like int GetElementAt( int index) { // range check iter = List.begin(); iter+=index; return *iter ; }
Engineering is the effort !
-
Need to know if I can directly access elements in an STL array based on the Iterator .. As for eg List contains { 1,2,3,4,5,6,7,8 } if List::Iterator iter = List.begin() Now to access nth element can the routine be like int GetElementAt( int index) { // range check iter = List.begin(); iter+=index; return *iter ; }
Engineering is the effort !
-
Need to know if I can directly access elements in an STL array based on the Iterator .. As for eg List contains { 1,2,3,4,5,6,7,8 } if List::Iterator iter = List.begin() Now to access nth element can the routine be like int GetElementAt( int index) { // range check iter = List.begin(); iter+=index; return *iter ; }
Engineering is the effort !