Specializing STL vector, store int value in vector - C++ STL

C++ examples for STL:vector

Description

Specializing STL vector, store int value in vector

Demo Code

#include <iostream> 
#include <array> 
#include <vector> 
#include <ios> 


using namespace std; 

int main(int argc, char *argv [])
{   /*from  ww w.  j  a  v  a  2 s.  c  o  m*/

    using MyVector = vector<int>; 
    
    MyVector myVector = { 0, 1, 2 }; 
    myVector.push_back(3); 
    myVector.push_back(4); 
        return 0; 
}

Related Tutorials