3 ms·
No mystery. C's char type is a single byte, an integer type of (usually) 8 bits, though the actual size is platform-dependent. A char may be signed or unsigned,
by gregjor 13y ago
No mystery. C's char type is a single byte, an integer type of (usually) 8 bits, though the actual size is platform-dependent. A char may be signed or unsigned, like the other integer types (short, int, long).
The value of a char is the ASCII code for the character, so 'a' is stored as the integer 97.
This is documented in "The C Programming Language" on pages 35-36.
C does not have a string type. By convention a string is an array of char with a null (0) byte at the end.
C++ follows the same conventions for char and arrays of char, but implements "real" strings with more string-like behavior.