Character datatype in C
The character data type in C, stores a single character within a single quotation mark and requires a single byte of memory in almost all compilers.
The char keyword in c is used to declare or define the character in C. It can hold alphabet, digits from 0 to 9 and special symbols and the format specifier for character is %c.
Read More: Data Types in Introduction
Let us understand this through a program :-
The output of the following will be code :-
We can calculate size, limit of the char data type can hold in C using sizeof() operator and macros.
Output of the following code :-
The character can be divided into two types : signed char and unsigned char
|signed char||-128 to 127|
|unsigned char||0 to 255|