C defines several keywords, each with special meaning to the compiler. Keywords identify statement constructs and specify basic types and storage classes. Keywords cannot be used as identifiers and cannot be declared.
Table 1-3 lists the C keywords.
auto | double
| int |
struct |
break | else |
long | switch
|
case |
enum | register
| typedef |
char | extern
| return |
union |
const
| float |
short | unsigned
|
continue |
for | signed
| void |
default | goto
| sizeof |
volatile |
do
| if | static
| while |
__int8 (Alpha) |
__int16 (Alpha)
| __int32
(Alpha) | __int64
(Alpha) |
__unaligned (Alpha) |
__restrict |
Keywords are used as follows:
auto
, extern
, register
,
static
)
char
,
const
, double
,
enum
, float
, int
,
__int64
(Alpha) ,
long
, __restrict
,
short
, signed
, struct
,
__unaligned
(Alpha) ,
union
, unsigned
, void
,
volatile
)
break
,
case
, continue
, default
,
do
, else
, for
,
goto
, if
, return
,
switch
, while
)
typedef
)
sizeof
)
Use of a keyword as a superfluous macro name is not recommended, but is legal; for example, to change the default size of a basic data type:
#define int short
Here, the keyword int
has been redefined as
short
, which causes all data objects declared with
the int
data type to be stored as short
objects.