Character data type
The definition
char c;
creates a 1-byte cell that can hold one character.
To store lowercase x in the variable c, we can write
c = 'x';
Note the single quotation marks.
To print a character using printf, we use the format descriptor %c.
Previous slide
Next slide
Back to first slide
View graphic version