In C programming, the char data type comes handy for storing characters like letters and punctuation marks. However, from a technical point of view, it is an integer type, because the char type actually stores integer values, not characters. To store and recognize the characters, a computer uses a numerical code in which the characters are represented by integer values. ASCII code is the most popular codes among such numerical codes. The full form of ASCII is American Standard Code for Information Interchange.
An example to explain the use of ASCII code in representing characters is that the character ‘A’ is represented by the integer value 65. So, in order to store the letter ‘A’, the ASCII value or integer value of ‘A’, i.e. 65 is stored.
The standard ASCII code runs numerically from 0 to 127. This is a small range created so that 7 bits can hold the code. Typically, the char data type reserves a memory block of 8 bits and it is more than enough to fit in the standard ASCII code. The systems like IBM PC and Apple Macintosh offer extended ASCII codes different from each other but still fit in the 8 bit limit.
The data type char stores a single character that takes up 1 byte (8 bits) in memory and can store the values within the range of -128 to 127. Hence, it can be said that C makes sure that the char data type creates a room large enough to store the basic character set for the system on which C is implemented.