vector <intv1;
v1.push_back( 10 ); //adds 10 to the tail
v1.push_back( 20 ); //adds 20 to the tail
cout << "The size of v1 is " << v1.size( ) << endl;
v1.clear( ); //clears the vector
I have a few questions:
Does clear() deallocates the memory too (like resize())?
Does clear() work for 2D vectors?
Or clear() is to be called for each dimension?
thanks in advance..
Comment