General Reference Material
The Standard ASCII Character Set and Codes
ASCII is an acronym for "American Standard Code for Information Interchange". There are several "extended" ASCII character sets in use which contain 256 characters, and which include characters for drawing "character graphics" and oddball characters like the "smiley face", but these do not concern us here. The Standard ASCII Character Set and Codes table given below contains 128 characters with corresponding numerical codes in the range 0..127 (decimal).
The characters in the table fall into two main categories:
Let's make a few observations about the table, some of which may come in handy when you have to manipulate characters in your programs for one reason or another.
First, note that the table has four columns, and that the first one differs from the remaining three in that it contains only control characters, while the rest of the table (with the exception of the last character in the last column) contains only printable characters. The ASCII characters with codes in the range 0 to 31 and which are called control characters (or control codes) are "invisible", i.e., they do not represent printable characters on the screen. Instead they provide a way to give instructions to peripheral devices such as printers and screens. For example, the character with code 7 (the BEL character, denoted by Ctrl+G, or CTRL+G, or ^G) will cause the little bell on a terminal to ring when it is sent.
Each control character has a two-character or three-character mnemonic (such as BEL) and may also be represented in a manner illustrated (for BEL) by Ctrl+G, or CTRL+G, or ^G. Here Ctrl, CTRL and ^ represent the CONTROL key, and to send the corresponding symbol from the keyboard the notation is to be interpreted as an instruction to hold down the CONTROL key while pressing the G key.
Normally you need not worry about the meaning of the various mnemonics for the control characters. Only if you need to become much more familiar with the ASCII control codes than is usually the case for the average programmer will you need to concern yourself with such details.
The remaining characters all represent printable characters, except for the last (code 127, or DEL), which is also a control character. The character with code 32 is a special case. This one represents the blank space character which is, of course, invisible by its nature, but is nevertheless regarded as a "printable" character since it moves the cursor one space to the right, leaving a "blank space" behind.
Here are some other occasionally useful facts about the table: