/* related posts with thumb nails */

IO Manipulators:

4   System defined manipulator are defined in “iomanip.h”
4   These are defined by the system and can be directly used with stream operators.


Manipulator
Meaning
skipws
Skips white spaces
skipws
Does not skip white spaces on input
showbase
Shows base indicator i.e. 0 for octal 0x for hexadecimal
showpoint
Shows decimal point and zeros after for float value
noshowpoint
Does not Show decimal point and zeros after for float value
showpos
Shows “+” before positive integers
noshowpos
Does not show “+” before positive integers
dec
Convert to decimal
oct
Convert to octal
hex
Convert to hexadecimal
left
Left justify output
right
Right justify output
scientific
Uses exponential format for float values
endl
Inserts new line
setw(n)
Sets width
setfill(n)
Sets fill character
setprecesion(n)
Sets floating point precesion
setiosflags(flags)
Sets formatting flags
resetiosflags(flags)
clears formatting flags


Example:

main()
{
char x[]=“hello”;
cout<<setfill(‘*’)<<setw(10)<<left;
cout<<x;           // prints “hello*****”

float f=3.456;
cout<<setprecesion(2); 
cout<<endl<<f; // prints 3.46

int x=30;
cout<<endl<<oct<<x;  // prints 36
}

Related Topics:

1 comments:

Unknown said...

The King Casino - CommunityKhabar
The King wooricasinos.info Casino is the kadangpintar only casino near the casino. All casino gri-go.com games are legal and the game variety is huge! The games communitykhabar are also available at any https://febcasino.com/review/merit-casino/ of the

Post a Comment