C Programming language Keywords
The identifiers listed in Table are reserved C keywords. You shouldn't use them for any other purpose in a C program. They are allowed, of course, within double quotation marks.
Also included is a list of words that aren't reserved in C but are C++ reserved words. These C++ reserved words aren't described here, but if there's a chance your C programs might eventually be ported to C++, you need to avoid these words as well.
Reserved C keywords:
Keyword |
Description |
Asm |
Keyword that denotes inline assembly language code. |
Auto |
The default storage class. |
Break |
Command that exits for, while, switch, and do...while statements unconditionally. |
Case |
Command used within the switch statement. |
Char |
The simplest C data type. |
Const |
Data modifier that prevents a variable from being changed. See volatile. |
continue |
Command that resets a for, while, or do...while statement to the next iteration. |
default |
Command used within the switch statement to catch any instances not specified with a case statement. |
Do |
Looping command used in conjunction with the while statement. The loop will always execute at least once. |
double |
Data type that can hold double-precision floating-point values. |
Else |
Statement signaling alternative statements to be executed when an if statement evaluates to FALSE. |
Enum |
Data type that allows variables to be declared that accept only certain values. |
extern |
Data modifier indicating that a variable will be declared in another area of the program. |
Float |
Data type used for floating-point numbers. |
For |
Looping command that contains initialization, incrementation, and conditional sections. |
Goto |
Command that causes a jump to a predefined label. |
If |
Command used to change program flow based on a TRUE/FALSE decision. |
Int |
Data type used to hold integer values. |
Long |
Data type used to hold larger integer values than int. |
register |
Storage modifier that specifies that a variable should be stored in a register if possible. |
return |
Command that causes program flow to exit from the current function and return to the calling function. It can also be used to return a single value. |
Short |
Data type used to hold integers. It isn't commonly used, and it's the same size as an int on most computers. |
signed |
Modifier used to signify that a variable can have both positive and negative values. See unsigned. |
Sizeof |
Operator that returns the size of the item in bytes. |
Static |
Modifier used to signify that the compiler should retain the variable's value. |
Struct |
Keyword used to combine C variables of any data type into a group. |
switch |
Command used to change program flow in a multitude of directions. Used in conjunction with the case statement. |
typedef |
Modifier used to create new names for existing variable and function types. |
Union |
Keyword used to allow multiple variables to share the same memory space. |
unsigned |
Modifier used to signify that a variable will contain only positive values. See signed. |
Void |
Keyword used to signify either that a function doesn't return anything or that a pointer being used is considered generic or able to point to any data type. |
volatile |
Modifier that signifies that a variable can be changed. See const. |
While |
Looping statement that executes a section of code as long as a condition remains TRUE. |
Reserved C++ keywords:
In addition to the preceding keywords, the following are C++ reserved words:
Catch |
inline |
template |
Class |
new |
this |
Delete |
operator |
throw |
except |
private |
try |
finally |
protected |
virtual |
Friend |
public |
|