Vector

#include <iostream>
#include<vector>
using namespace std;
int main()
{
    vector< int > v;
 v.push_back( 1 );
 v.push_back( 2 );
 v.push_back( 3 );
 v.push_back( 4 );
  
 for(int i=0; i<v.size(); i++)
  
 cout << v[i] << endl;
    system("pause");
    return 0;
}

This is the output:
1
2
3
4

0 comments:

Post a Comment