 |
» |
|
|
 |
Type specifiers indicate
the format of the storage associated with a given data object or the
return type of a function. Syntax |  |
type-specifier ::=[LINEBREAK] char[LINEBREAK] short[LINEBREAK]
int[LINEBREAK] long[LINEBREAK] long long[LINEBREAK]
unsigned[LINEBREAK] signed[LINEBREAK] float[LINEBREAK]
double[LINEBREAK] void[LINEBREAK] struct-or-union-specifier[LINEBREAK] enum-specifier[LINEBREAK]
typedef-name Description |  |
Most of the type specifiers are single keywords.
(Refer to Chapter 10: “HP C/HP-UX Implementation Topics ” for sizes of types.) The syntax of the type specifiers permits
more types than are actually allowed in the C language. The various
combinations of type specifiers that are allowed are shown in Table 3-1. Type specifiers that are
equivalent appear together in a box. For example, specifying unsigned is equivalent to unsigned
int. Type specifiers may appear in any order, possibly
intermixed with other declaration specifiers. Table 3-1 C Type Specifiers void | char | signed char | unsigned
char | short, signed short, short int, or signed short int | unsigned
short, or unsigned short int | int, signed, signed
int, or no type specifiers | unsigned, or unsigned int | long, signed long, long
int, or signed long int | long long, signed long long, long long int, or signed long long
int | unsigned
long, or unsigned long int | unsigned
long long, or unsigned long long
int | float | double | long double | struct-or-union
specifier | enum-specifier | typedef-name |
If no type specifier is provided in a declaration,
the default type is int. Floating-point types in C are float (32 bits), double (64 bits), and long double (128
bits).
|