What are the rules for defining character constants in the C language?
The rules for defining character constants in the C language are as follows:
- Character constants are enclosed in single quotes.
- Only one character is allowed. For example: ‘a’.
- Special characters can be represented using escape sequences, for example: ‘\n’ represents a newline character.
- Character constants can be any character, including letters, numbers, special characters, etc.
- Character constants are stored in memory in the form of ASCII codes, taking up 1 byte of space.