M
madhu
http://msdn2.microsoft.com/en-us/library/fs5a18ce(VS.80).aspx
vector <int> v1;
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..
vector <int> v1;
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..