Created
September 24, 2020 14:39
-
-
Save vbuterin2/381e1c07a02704cd4812ee71646a0c1d to your computer and use it in GitHub Desktop.
This file contains 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
// vector::push_back | |
#include <iostream> | |
#include <vector> | |
int main() | |
{ | |
vector<int> v1; | |
const vector<int> v2; | |
// begin() function is used to return an iterator pointing to the first element of the vector container. | |
auto it1 = v1.begin(), it2 = v2.begin(); | |
// cbegin will return a const_iterator unconditionally. begin() returns the iterator to beginning while cbegin() returns const_iterator to beginning. | |
auto it3 = v1.cbegin(), it4 = v2.cbegin(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment