Explain manipulators, C/C++ Programming

Assignment Help:

Manipulators

There are several classes in the iostream.h header file. One of them is ios class. This class stores the format state. For example, some bits explain the base in which the numbers will be printed, some bits explain the field width. This header file has functions called manipulators, using which the output format can be controlled. There are 3 manipulators dec(), oct(), hex() to set the base in which a given number will be printed. These manipulators are called in two ways :

                hex(cout);                                           // Pass the object name

                cout<< hex;                        // use the insertion operator .

 

But since these manipulators are not member functions of the class , it cannot be used as follows :

                cout.hex();                         // Not allowed.

 


Related Discussions:- Explain manipulators

Described the difference among "new" and "operator new" ?, Described the di...

Described the difference among "new" and "operator new" ? A:"operator new" works such as malloc.

Define bitwise left shift and right shift operators, Define Bitwise Left Sh...

Define Bitwise Left Shift and Right Shift Operators: >? The bitwise shift operators shift their first operand right (>>) or left ( // Illustration of the bitwise right shi

Law of motion, Ask question asdasasas#Minimum 100 words accepted#

Ask question asdasasas#Minimum 100 words accepted#

C program for bank account, Aim: To implement a program for bank account u...

Aim: To implement a program for bank account using static data type. Code: class bank {             static int acc_no;             int acc;             float b

Assignment, write a function rise to the power to find the exponent of a nu...

write a function rise to the power to find the exponent of a number whether function is called

C program to store all ascii char into a file, Program is to store all ASCI...

Program is to store all ASCII char into a file: void main()     {   ofstream  fout("ascii.txt");   int i,n=256;   for(i=1;i     {     fout     }

C program to maintain database of employees, Aim: To implement a program t...

Aim: To implement a program to maintain information of employees in an educational institute using inheritance. Code:                       class staff {

Static data members and static member function, Static Data Members: A ...

Static Data Members: A data member inside the class can construct as static data member.   There are few guidelines to be followed when declaring static data member.

Basics, conceptual difference between big o,big thete and big omega

conceptual difference between big o,big thete and big omega

Matematic, how to make program c++

how to make program c++

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd