C Tokens, Identifiers, and Keywords: Understanding Tokens and Their Types
What Is a Character Set?
Like any programming language, C has its own character set. A C program is a sequence of instructions that manipulate data composed of characters and symbols. The compiler ignores most formatting characters, but they are essential for human readability.
The C character set is divided into four groups:
- Letters (uppercase A‑Z and lowercase a‑z)
- Numbers (digits 0‑9)
- White space (spaces, tabs, newlines, carriage returns)
- Special characters (punctuation and symbols)
Below is a comprehensive list of the special characters used in C:
| Special Character | Description |
|---|---|
| , | Comma |
| { | Opening curly bracket |
| . | Period |
| } | Closing curly bracket |
| ; | Semicolon |
| [ | Left bracket |
| : | Colon |
| ] | Right bracket |
| ? | Question mark |
| ( | Opening parenthesis |
| ' | Apostrophe |
| ) | Closing parenthesis |
| " | Double quotation mark |
| & | Ampersand |
| ! | Exclamation mark |
| ^ | Caret |
| | | Vertical bar |
| + | Addition |
| / | Forward slash |
| - | Subtraction |
| \ | Backward slash |
| * | Multiplication |
| ~ | Tilde |
| / | Division |
| _ | Underscore |
| > | Greater‑than / closing angle bracket |
| $ | Dollar sign |
| < | Less‑than / opening angle bracket |
| % | Percentage sign |
| # | Hash sign |
What Is a Token in C?
A token is the smallest meaningful unit that the C compiler recognizes. During lexical analysis, the source code is broken down into tokens before parsing and code generation. C tokens fall into six categories:
- Keywords
- Operators
- Strings
- Constants
- Special Characters
- Identifiers

Keywords and Identifiers
Every word in C is either a keyword or an identifier. Keywords are reserved, have fixed meaning, and cannot be reused for naming. Identifiers are user‑defined names for variables, functions, types, and more.
Keywords in C
There are 32 keywords in the C language, all written in lowercase. They are listed below in a tidy table for quick reference:
| C Keywords | |||
|---|---|---|---|
| auto | double | int | struct |
| break | else | long | switch |
| case | enum | register | typedef |
| char | extern | return | union |
| const | short | float | unsigned |
| continue | for | signed | void |
| default | goto | sizeof | volatile |
| do | if | static | while |
Identifiers
An identifier is the name you give to a variable, function, structure, enum, etc. The C standard imposes several rules on identifiers:
- The first character must be a letter (A‑Z, a‑z) or an underscore (_).
- Subsequent characters may be letters, digits (0‑9), or underscores.
- Identifiers cannot be any of the 32 keywords.
- They must not contain whitespace.
- While not enforced by the compiler, meaningful names improve code readability and maintainability.
Summary
- C tokens are the smallest units the compiler processes.
- Keywords are reserved words with fixed meanings; there are 32 of them.
- Identifiers uniquely name program elements and follow strict naming rules.
C Language
- Interrupts Explained: Types, Mechanisms, and Applications in Modern Computing
- Understanding C# Keywords and Identifiers: Rules, Lists, and Best Practices
- C Keywords & Identifiers: A Practical Guide
- 3D Printing Explained: Types, Processes, and How It Works
- Honing: Process, Parameters, Types, and Key Advantages for Superior Surface Finish
- Reamer Tools: Types, Terminology, and Practical Uses
- Conveyor Systems Explained: Types, Applications, and Benefits (PDF Included)
- Understanding Casting Patterns: Types, Benefits, and Color Schemes
- Industrial Automation Explained: Types & Benefits for Smart Factories
- Lathe Machines Explained: Components, Operations, and Types – Free PDF Guide