{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

IO_format - Programming Stream Manipulators Prog...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
Programming Stream Manipulators
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Prog. Fundamentals I: Stream Manipulator Slide 2 Stream Manipulators in iostream.h Library I/O stream manipulators modify the behavior of insertions ( << ) and extractions ( >> ). Examples: endl , flush oct , dec , hex (persistent effect: a change stays effective until another change is requested) int i = 10; cout << i << ” ” << i + i << endl; // 10 20 cout << oct << i << ” ” << i + i << endl; // 12 24 cout << hex << i << ” ” << i + i << ” ” << dec << i << endl; // a 14 10 decimal: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 octal: 0 1 2 3 4 5 6 7 10 11 12 13 14 15 16 17 20 21 22 23 24 Hexdecimal: 0 1 2 3 4 5 6 7 8 9 a b c d e f 10 11 12 13 14
Background image of page 2
Number Systems Octal Base 8 8 symbols Hexadecimal Base 16 16 symbols More compact representation of the binary system Decimal Octal Hexadecimal 00 00 0 01 01 1 02 02 2 ... ... ... 07
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 6

IO_format - Programming Stream Manipulators Prog...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon bookmark
Ask a homework question - tutors are online