Home / Tips / C++ Tips / C++: ..Manipulators continued

“Chishiki” is Japanese for “knowledge.” e-chishiki.com aims to bring software developers, information security professionals, IT executives and other IT pros a rich body of knowledge in the form of articles, interviews, tutorials and technical discussions. Our contributors are among the biggest names in the Indian IT industry and include noted authors, educators and practitioners.

C++: ..Manipulators continued


..Manipulators continued


Manipulator

Purpose

noshowpos Do not show plus sign for positive values
uppercase Display uppercase A-F for hex values, and E for scientific values
nouppercase Do not display hex values in uppercase
showpoint Show decimal point and trailing zeros for float values
noshowpoint Do not show decimal point & trailing zeros for float values
scientific Use scientific notation for printingfloat values
fixed Use fixed notation for printing float values
ends Insert null character to terminate an output string
flush Flush the output stream
lock Lock file handle
unlock Unlock file handle
setw ( int n ) Changes the field width for output to n
setfill ( char n ) Changes the fill character to n ( default is a space)
setprecision ( int n ) Changes the precision to n places after decimal point
setbase ( base n ) Changes base to n, where n is 8, 10 or 16. If n is zero, output is base 10, but input uses the C convention: 10 is 10, 010 is 8, and OxC is 12 ,
setiosflags ( fmtflags n ) Sets format flags specified by n Setting remains in effect until next change
resetiosflags ( fmtflags n) Clears only the format flags specified by n. Setting remains in effect until next change

Comments

Log in or create a user account to comment.

On Sale From April 2008

Let Us C
8th Ed.
C programming classic & best seller. 1 million+ copies sold!

Y. Kanetkar

On Sale From April 2008

Introduction to Object Oriented Programming & C++

Y. Kanetkar

On Sale From Fall 2008

Microsoft .NET Framework: Web Application Security

Vijay Mukhi

On Sale From Nolvember 2008

Quest C++ Courseware
12+ hours of instructional audio and animated slides.

Y. Kanetkar Asang Dani

On Sale From November 2008

A Programmer's Guide to Web Application Security

Vijay Mukhi

Latest Forum Posts