Vectors class 1

  // Online C++ compiler to run C++ program online


#include <iostream>

#include <vector>


using namespace std;

int main(){

    vector<int> v;

    

    for (int i=0;i<100;i++){

        cout<<"cap: "<<v.capacity()<<endl;

        cout<<"size: "<<v.size()<<endl;

        v.push_back(i);

        

        

    }

    //v.popback()

    //v[1]=100;

    //cout<<v.at(2)

}

Comments

Popular posts from this blog

Sum of Even Numbers till N

Find the Runner-Up Score!

Print All Substrings