setw() in C++ …

I just got familiar with the setw(int) function in C++…

Guess what it does .. ??

It just allocates a block of the specified size with the contents being right indented..

E.g.,

cout<<<“hi”;
cout<<<“blogs”;

output:

     hi

blogs

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