E. ASCII Codes

This appendix presents ASCII codes according to decimal value, hexadecimal value, and corresponding character. Hexadecimal codes can be used to embed values into a string. You can also print characters by using a (char) cast. For example:

cout << "Hex code 7e is " << "\x7e" << endl;// Print ASCII codes from 32 to 42.for (int i = 32; i <= 42; i++)    cout << i << ": " << (char) i << endl;

Some nonprintable characters have special meanings:

Image NUL: null value

Image ACK: acknowledgment signal (used in network communications) ...

Get C++ Without Fear: A Beginner’s Guide That Makes You Feel Smart, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.