This documentation is archived and is not being maintained.

Specifiers

This section explains the decl-specifiers portion of declarations. (The syntax for declarations is given at the beginning of this section.)

Grammar

decl-specifiers :
decl-specifiersopt decl-specifier
decl-specifier :
storage-class-specifier
type-specifier
fct-specifier
friend
typedef
__declspec ( extended-decl-modifier-seq )

The Microsoft-specific keyword, __declspec, is discussed in Extended Attribute Syntax.

The decl-specifiers portion of a declaration is the longest sequence of decl-specifiers that can be construed to be a type name. The remainder of the declaration is the name or names introduced. The examples in the following list illustrates this concept:

Declaration decl-specifiers name
char *lpszAppName;
char *
lpszAppName
typedef char * LPSTR;
char *
LPSTR
LPSTR strcpy( LPSTR, LPSTR );
LPSTR
strcpy
volatile void *pvvObj;
volatile void *
pvvObj

Because signed, unsigned, long, and short all imply int, a typedef name following one of these keywords is taken to be a member of declarator-list, not of decl-specifiers.

Note   Because a name can be redeclared, its interpretation is subject to the most recent declaration in the current scope. Redeclaration can affect how names are interpreted by the compiler, particularly typedef names.

See Also

Declarations

Show: