Created
September 24, 2020 14:33
-
-
Save vbuterin2/511f17c7c051fae58cd8317ff4351efa 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() | |
{ | |
std::vector<int> my_vector; | |
int my_int; | |
std::cout << "Please enter some integer (enter 0 to end): \n"; | |
do { | |
std::cin >> my_int; | |
my_vector.push_back(my_int); | |
} while (my_int); | |
std::cout << "my vector stores " << int(my_vector.size()) << " numbers. \n"; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment