ASCII
(American Standard Code for Information Interchange)
cplusplus.com

As you probably know, in its lower level computers can only handle 0s (zeros) and 1s (ones). Using sequences of 0 and 1 a computer can handle numbers in binary format (as explained in document numeral radixes). Nevertheless there is no such evident way to represent letters with 0s and 1s. For this purpose is the ASCII code used.

The ASCII code is a table or list containing all the letters of the alphabet plus a variety of additional characters. In this code, each character is represented by an order number, which is always the same. For example, the ASCII code to represent the capital letter A is always represented by order number 65, which is easily representable using 0s and 1s in binary notation (1000001).

The standard ASCII code defines 128 character codes (from 0 to 127). The first 32 are control codes (non-printable), and the other 96 are representable characters:

* 0 1 2 3 4 5 6 7 8 9 A B C D E F
0 NUL SOH STX ETX EOT ENQ ACK BEL BS TAB LF VT FF CR SO SI
1 DLE DC1 DC2 DC3 DC4 NAK SYN ETB CAN EM SUB ESC FS GS RS US
2   ! " # $ % & ' ( ) * + , - . /
3 0 1 2 3 4 5 6 7 8 9 : ; < = > ?
4 @ A B C D E F G H I J K L M N O
5 P Q R S T U V W X Y Z [ \ ] ^ _
6 ` a b c d e f g h i j k l m n o
7 p q r s t u v w x y z { | } ~  
* This panel is organized to be easily read in hexadecimal: row numbers represent the first digit and the column numbers represent the second one. For example, the A character is located at the 4th row and the 1st column, so it would be represented as hexadecimal number 0x41 (65).

In addition to the 128 standard ASCII codes (the ones listed above ranging from 0 to 127), most machines have another 128 extra codes which form what is known as extended ASCII (with ranges from 129 to 255). This extended ASCII character set is platform-dependent, meaning that it may vary from one machine to another, or between operating systems.

The most-used extended ASCII character sets are OEM and ANSI.

The OEM character set is included in all PC-compatible computers as the default character set when the system boots before loading any operating system and under MS-DOS. It includes some foreign signs, some marked characters and also pieces to draw simple panels. Unfortunately it is usually redefined by some regional country-specific configurations to include local symbols.

The ANSI character set is a standard that is included in systems like Windows, some UNIX platforms and some applications. It includes many more local symbols and marked letters than OEM so it can be used with more languages without having to be redefined:

Here you have an interactive Decimal-Hexadecimal-Octal-ASCII converter (Netscape 3+ or MSIE 4+):

DEC:
HEX:
OCT:
ASCII:

Write a datum in the suitable input field and press TAB

©The C++ Resources Network, 2000-2001 - All rights reserved
Return back
Return to Documents Section