Outputting integers

Integers can also be printed in columns using the setw and setfill methods. You can insert manipulators to print integers in base 8 (oct), base 10 (dec), and base 16 (hex). (You can also use the setbase manipulator and pass the base you want to use, but the only values allowed are 8, 10, and 16.) The number can be printed with the base indicated (prefixed with 0 for octal or 0x for hex) or without using the showbase and noshowbase manipulators. If you use hex, then the digits above 9 are the letters a to f, and by default these are lowercase. If you prefer these to be uppercase, then you can use the uppercase manipulator (and lowercase with nouppercase).

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset