You are here

Overview of the Character Data Type

6 February, 2015 - 11:38

The character data type basically represents individual or single characters. Characters comprise a variety of symbols such as the alphabet (both upper and lower case) the numeral digits (0 to 9), punctuation, etc. All computers store character data in a one byte feld as an integer value. Because a byte consists of 8 bits, this one byte feld has 28 or 256 possibilities using the positive values of 0 to 255.

Most microcomputers use the ASCII (stands for American Standard Code for Information Interchange and is pronounced "ask-key") Character Set which has established values for 0 to 127. For the values of 128 to 255 they usually use the Extended ASCII Character Set. When we hit the capital A on the keyboard, the keyboard sends a byte with the bit pattern equal to an integer 65. When the byte is sent from the memory to the monitor, the monitor converts the integer value of 65 to into the symbol of the capital A to display on the monitor.

The character data type attributes include:

C++ Reserved Word

char

Represent

Single characters

Size

1 byte

Normal Signage

Unsigned (positive values only)

Domain (Values Allowed)

Values from 0 to 127 as shown in the standard ASCII Character Set, plus values 128 to 255 from the Extended ASCII Character Set

C++ syntax rule

Single quote marks _ Example: 'A'