C language Character Set
In C language you can use the following characters.
a, b, c, ... z
A, B, C, ... Z
The following table shows some special characters used extensively in C.
|Percent Sign or modulus operator|
|Period or dot symbol|
## Escape Sequences
Escape Sequences are used to print some special characters in the console which can’t be printed by directly using the keyboard such as newline, tab etc. Escape Sequences consists of 2 or more characters, the first character is
and the second character varies according to the need. Here are some common escape sequences.
|Escape Sequence||Meaning||What it does ?|
|carriage return|| |
|single quote|| |
|double quote|| |
Note: newline (
\n), backspace (
\b), Carriage return (
\r), tab (
\t), space (
Keywords are some reserved words that C language use for denoting something specific. In C Keywords are written in lowercase. C has only 32 Keywords.
Identifiers are the words we use to name entities like variables, functions, array, structure, symbolic constant etc.
The rules for naming identifiers are as follows:
- Identifiers must consist of alphabets, digits or underscores (
- The first character should be an alphabet or underscore (
- The identifier should not be a keyword.
- Identifiers can be of any length.
C is case-sensitive language so
MY_VAR are two distinct identifiers.
Some examples of valid identifiers:
Examples of invalid identifiers:
1digit – an identifier must not start with a number
my var – an identifier must not contain space between names
int is a keyword
some# – pound(
#) character is not allowed