C Language | Introduction to C | Keywords
The following table lists keywords in the C programming language.
These keywords cannot be used as identifiers in a program. Modern compilers may also prevent C++ keywords from being used as identifiers.
C Keywords
| Keyword | Description |
|---|---|
| asm | Indicates inline assembly code. |
| auto | Specifies the default storage class for a variable. |
| break | Exits a for, while, switch, or do...while statement unconditionally. |
| case | Used within a switch statement. |
| char | The simplest data type. |
| const | Specifies that a variable must not be modified. See volatile. |
| continue | Continues with the next iteration of a for, while, or do...while statement. |
| default | Used in a switch statement to handle values that do not match a case. |
| do | Used with while to create a loop that runs at least once. |
| double | Stores double-precision floating-point values. |
| else | Indicates the optional statement executed when an if condition evaluates to false. |
| extern | Specifies that a variable is declared elsewhere in the program. |
| float | Stores floating-point values. |
| for | Creates a loop with initialization, condition, and increment expressions. |
| goto | Transfers control to a defined label. |
| if | Changes the flow of a program according to a true or false condition. |
| int | Stores integer values. |
| long | Stores integer values with a range at least as large as int. |
| register | Requests that a variable be stored in a register when possible. |
| return | Ends the current function, returns control to its caller, and optionally returns a value. |
| short | Stores integer values with a range no larger than int. |
| signed | Specifies that a variable can store both positive and negative values. |
| sizeof | Reports the size of an item in bytes. |
| static | Specifies that the value of a variable must be preserved. |
| struct | Combines variables into a structured data type. |
| switch | Changes program flow according to multiple conditions and is used with case. |
| typedef | Defines a new name for an existing type. |
| union | Allows multiple variables to share the same memory region. |
| unsigned | Specifies that a variable stores only non-negative values. See signed. |
| void | Indicates that a function returns no value, or that a pointer is a generic pointer capable of referring to any data type. |
| volatile | Specifies that a variable may change unexpectedly. See const. |
| while | Repeats a statement while a specified condition evaluates to true. |
Additional C++ Keywords
| catch | inline | template |
|---|---|---|
| class | new | this |
| delete | operator | throw |
| except | private | try |
| finally | protected | virtual |
| friend | public |