c 2b 2b push back

Solutions on MaxInterview for c 2b 2b push back by the best coders in the world

showing results for - "c 2b 2b push back"
Mika
03 Jan 2017
1// vector::push_back
2#include <iostream>
3#include <vector>
4
5int main ()
6{
7  std::vector<int> myvector;
8  int myint = 2;
9
10  std::cout << "Please enter some integers (enter 0 to end):\n";
11
12  do {
13    std::cin >> myint;
14    myvector.push_back (myint);
15  } while (myint);
16
17  std::cout << "myvector stores " << int(myvector.size()) << " numbers.\n";
18
19  return 0;
20}