Minor changes are by default collapsed in the page history.
No changes
The page does not exist yet.
Failed to load changes
Version by on
Leave Collaboration
Are you sure you want to leave the realtime collaboration and continue editing alone? The changes you save while editing alone will lead to merge conflicts with the changes auto-saved by the realtime editing session.
C Programming Character Literals
Last modified by Microchip on 2023/11/10 10:59
Rules
Must be surrounded by single quotes (').
May include any single printable character (e.g. 'a').
May include any single non-printable character using escape sequences, also called diagraphs (e.g. '\0' for NUL).
Examples of Valid Character Literals
'a'
'T'
'\n'
'5'
'@'
' ' (space)
Examples of Invalid Character Literals
'me'
'23'
'''
Because the single quote (') is used to delimit character literals, the single quote cannot by itself be a character literal. It must be specified using an escape sequence: '\''.
Information
Although escape sequences look like two characters, the backslash (\) is treated specially in character and string literals. It signals that the character that follows is special. It either represents a non-printable character, as in the case of '\0' for NUL, or a character that cannot be used on its own in a character literal, such as the single quote or backslash themselves, which are represented as '\'' and '\\' respectively.
If you need to work with Microchip Support staff directly, you can submit a technical support case. Keep in mind that many questions can be answered through our self-help resources, so this may not be your speediest option.