Characters in C Programming Language

Notes:

Characters in C Programming Language


Character:
- is a symbol from the character set; enclosed in between pair of single quotations (i.e. an alphabet, a digit, a special symbol or an escape sequence character from the character set; enclosed in between pair of single quotations is called a character or a character constant.

// declaring and initializing a character type variable
char nameOfVariable = ’value’;
Ex:
char isGameOver = ’n’;
where
- value can be an alphabet, a digit, a special symbol or an escape sequence character from the character set

OR

// declaring and initializing a pointer to a character constant
char * pointerVariableName = ‘value’;
Ex:
char * isGameOver = ’n’;
where
- value can be an alphabet, a digit, a special symbol or an escape sequence character from the character set