#include<stdio.h> #include<vector> #include<string> using namespace std; int main() { int i; // String type vector is also same string str="Good line"; vector <string> ve; ve.push_back(str); // it store at 0 index ve.push_back("good day"); // it store at 1 index for( i=0; i< ve.size() ; i++ ) // We use size, It return Num of element in Vector printf(" %s <-\n", ve[i].c_str() ); ve.pop_back(); // it delete last value printf(" size %d\n", ve.size()); ve.clear(); // Now ve is empty return 0; }