STL : Vector [5] (empty, pop_back)


/* STL : Vector [5] (empty, pop_back)
Author : Tausiq
B.Sc in CTE (Studying)
United International University
*/

#include
#include
using namespace std;

int main ()
{
vector v (5);

for ( int i = 0; i < 5; i++ ) v [i] = i * 2; for ( int i = 0; i < 5; i++ ) cout << v [i] << ' '; cout << endl; while ( v.empty () != true ) { cout << "size: " << v.size () << endl; v.pop_back (); } return 0; } [/sourcecode]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s