CodeBase - Iterating through a vector and edit values via iterator
Return to the CodeBase listing
Category: Core
Version: 1.0
Information
Uploaded: 17th Jul 2010 14:30
Modified: 1st Jan 1970 01:00
Author: Dar13
Summary
Shows how to go through a vector and change the value of a vector using an iterator.
Full Description
First, we declare and initialize our vector(testVector), by pushing 3 values onto the back.<br /> Then we use a for loop to increment the iterator through the vector until the end is reached. As it goes through the vector, it increments the value the iterator is pointing to by 1(*itr+=1).<br /> The for loop also prints the new values to the console.<br /> Then the program waits for two return key presses to return to windows.
Comments
No comments yet.