Created
June 15, 2021 15:10
-
-
Save BogdanAriton/5c78d3cff7be38819c111ebbd71457db to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // what this does is just simply return a pointer to the first element in the vector | |
| std::vector<type>::iterator myItr = myVector.begin(); | |
| // we can simply for loop over the items using the iterator | |
| for (; myItr != myVector.end(); ++myItr) | |
| { | |
| // print them out | |
| } | |
| // You could simply use a for each loop to get the items directly | |
| for (auto &item : myVector) | |
| { | |
| // print them out | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment