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

Program, Write a ‘C’ program to accept any 3 digit integer number from the ...

Write a ‘C’ program to accept any 3 digit integer number from the keyboard and display the word equivalent representation of the given number.

Software reverse engineered, Project Description: I have software writte...

Project Description: I have software written with VB that i helped design, but now the original author died,(Neil Tromp), and the software ended up in the hands of someone else!

Create a program for decision structure , Create the following program or p...

Create the following program or propose one of your own. The program must include at least one of each of the following. Decision structure Repetitive structure fu

How do i allocate multidimensional arrays by new? , Can I free() pointers a...

Can I free() pointers allocated  along with new? Can I delete pointers allocated along with malloc()? A: No. It is completely legal, moral, and wholesome to employ malloc() a

Heating and thermodynamic, i want software to calculate heating or use ther...

i want software to calculate heating or use thermodynamic equation , pleas help me

Give a formal expression of the specification, A function REPAT is specifie...

A function REPAT is specified below. Function REPAT(c in Char, i in Int, s in mString) return in mString pre 1 ≤ i ≤ the length of s. post The returned value is a string identic

Write a program to illustrate array, Write a Program to illustrate Array? ...

Write a Program to illustrate Array? int x[100]; char text[80]; float temp[30]; static int marks[5]; We are able to use symbolic constants instead of expression. The valu

Program, program to check whether a given point lies inside a rectangle or ...

program to check whether a given point lies inside a rectangle or not

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