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

If statement, who to write max if statements in a program

who to write max if statements in a program

Function declarations and function definitions in cpp, FUNCTIONS It refe...

FUNCTIONS It refers to a subprogram that is meant to do a certain task. It is basically used to execute a set of operations and return information to the main or calling functio

Decodethecode, how to decode the numerals to string..

how to decode the numerals to string..

Tranporsition cipher, write a C program that can display the transpose form...

write a C program that can display the transpose form of a ciphertext matrix.

Palindorme, program coding for the conversion of string to a palindrome

program coding for the conversion of string to a palindrome

If one won''t explicitly call the destructor of a local then , if one won't...

if one won't explicitly call the destructor of a local; then how does he handle the above situation?

Declaring Integer variables with an example, How do you declare an integer ...

How do you declare an integer variable? Explain with an example.

Advance in c, create a program to populate the first array then the odd num...

create a program to populate the first array then the odd number is the second array and get the sum of the second array.

Poker room auto seat program, Poker Room auto seat program Project Descr...

Poker Room auto seat program Project Description: I want a script for an online poker site. It requires to be scanning all the available tables and when the table meets certa

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