Characters are
always only ONE letter or ONE character.
Character literals always appear inside
single quotation marks.
Define char variables for character data.
|
 |
//
Example of character literals
#include <iostream.h>
int main(void)
{
char first, middle, last;
first = 'D;
middle = 'O';
last = 'G';
// Rest of program would follow
NOTE: Character variable can
be initialized when the variable is declared:
char HonorGrade = 'A';
//Declare and initialize
|