Skip to main content

Character Set in C Programming

The character set in C is the set of characters that are recognized by the compiler and that can be used in identifiers, string literals, and other parts of the program.

The basic character set includes the letters of the alphabet (uppercase and lowercase), digits (0-9), and various special characters such as punctuation marks, whitespace characters and symbols.

The character set used by the C compiler is often referred to as the ASCII character set, which stands for American Standard Code for Information Interchange.

Alphabets

Uppercase: A B C ... X Y Z
Lowercase: a b c ... x y z
Case sensitive

C accepts both lowercase and uppercase alphabets as variables and functions but C is case sensitive. For example, count and Count are two different variable names in C, and they will be treated as separate entities by the compiler.

Digits

0 1 2 3 4 5 6 7 8 9

Special Characters

,   <   >   .   _
( ) ; $ :
% [ ] # ?
' & { } "
^ ! * / |
- \ ~ +

White space characters

space, tab, newline

Example

#include <stdio.h>
int main()
{
int _MY_AGE = 30;
printf("My Age: %d\n", _MY_AGE);

return 0;
}
Output:

Output:

My Age: 30