|
From: Daniel K. O. <dan...@gm...> - 2006-06-11 01:25:52
|
Erik Schmidt escreveu: > is there a way to get an iterator to a specific point in a vector? > If your "specific point" can be found through an index, you can try: int i = ...; vector<whatever>::iterator it = container.begin(); advance(it, i); This also works for other containers; if you want to make sure your code only works with random access iterators, you can just use it+=i. More details here: http://www.roguewave.com/support/docs/sourcepro/edition9/html/stdlibref/advance.html --- Daniel K. O. |