VECTOR
USING VECTOR CLASS Note: std::cout, std::cin, std::endl are used to resolve compilation error, you can use cout, cin, endl instead of that. #include <iostream> #include <vector> using namespace std; void display(vector<int> &v){ std::cout<<"Displaying the vector: "; for (int i=0;i< v.size();i++) { std::cout << v[i] <<" "; // std::cout << v.at(i) <<" "; } std::cout << "" << std::endl; } int main() { std::cout<<std::endl<<"\t\tZero length vector"<<std::endl; vector<int> vec1; int element,size=5; //cplusplus vector methods std::cout << "Enter the size of your vector: "; std::cin>>size; std::cout<<std::endl<<"\t\tpush_back in vector"<<std::endl; for(int i=0; i<size; i++) { std::cout << "Enter an element to add to the vector: "; std::cin>...