C Keywords
Keywords are reserved words that have a special meaning for the compiler. You cannot use them as names of your variables or functions. All keywords are in small letters.
List of 32 keywords in C
| Keyword | Keyword | Keyword | Keyword |
|---|---|---|---|
| auto | break | case | char |
| const | continue | default | do |
| double | else | enum | extern |
| float | for | goto | if |
| int | long | register | return |
| short | signed | sizeof | static |
| struct | switch | typedef | union |
| unsigned | void | volatile | while |
Newer standards (C99 and later) added a few more, like inline, restrict and _Bool. The above 32 are the classic ones.
Keywords by use
| Use | Keywords |
|---|---|
| Data types | int, char, float, double, void, short, long, signed, unsigned |
| Decisions | if, else, switch, case, default |
| Loops | for, while, do, break, continue, goto |
| Storage | auto, static, extern, register |
| Others | const, enum, struct, union, typedef, sizeof, return, volatile |
Note:
Printing int as a variable name gives a compile error. But Int or total are fine, because C is case sensitive.
Next: C Variables.
Congratulations! Chapter Finished. Learn more about the similar topics:
| Exercises & Assignments |
|---|
| No Content Found. |
| Interview Questions & Answers |
|---|
| No Content Found. |