Keywords are reserved words with fixed meaning (int, if, return). Identifiers are names you create for variables, functions, and types. They may use letters, digits, and _, cannot start with a digit, and cannot be keywords.
Remember
valid: count _tmp total2 max_value
invalid: 2fast my-var int float
Reference
Cheat Sheet
Keep these facts handy while you work with Keywords and Identifiers in C.
Topic
Detail
Keywords
int, char, if, else, for, while, return, struct ...
Allowed chars
Letters, digits, underscore
Start with
Letter or underscore, never a digit
Style
snake_case is common in C
Code
C Examples
Compile each example with gcc file.c -std=c11 -Wall -o out. Next: Variables.
Example 1 — Valid identifiers in use
Descriptive names make code easier to read than single letters.
C
#include <stdio.h>
int main(void) {
int student_count = 28;
int _unused = 0;
double average_score = 82.5;
printf("%d students, average %.1f\n", student_count, average_score);
return 0;
}
Output
28 students, average 82.5
How It Works
Underscores separate words in student_count.
A leading underscore is legal, but avoid names like _Total that C reserves.
Keywords such as int and double appear only as types.
Edge Cases & Pitfalls
Check these before relying on Keywords and Identifiers in real programs.
rsvd
Reserved names
Names starting with an underscore and a capital letter, or with two underscores, are reserved for the implementation.
case
Case confusion
Value and value are different identifiers. Pick one style and stick to it.
Remember
Key Takeaways
Keywords: cannot be reused as names.
Rules: letters, digits, _; no leading digit.
Names: choose descriptive identifiers.
One line: Keywords are reserved words with fixed meaning (int, if, return).
Frequently Asked Questions
C99 has 37 keywords and C11 adds more such as _Alignas and _Static_assert. The core ones are int, char, float, double, if, else, for, while, return, struct, and typedef.
Compilers must distinguish at least 31 characters for internal names, and modern compilers allow much more. Keep names reasonably short anyway.
Continue with "C Variables" next. Declare, initialize, and update named storage for values. The C Fundamentals hub lists every topic in order.