Specifiers

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

The following are declaration specifiers:

storage-class-specifiertype-specifierfunction-specifierfriendtypedef__declspec ( extended-decl-modifier-seq )

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

Remarks

The decl-specifiers portion of a declaration is the longest sequence of decl-specifiers that can be construed to be a type name, not including the pointer or reference modifiers. The remainder of the declaration is the declarator, including the name introduced. The examples in the following list illustrates this concept:

Declaration

decl-specifiers

declarator

char *lpszAppName;
char
*lpszAppName
typedef char * LPSTR;
char
*LPSTR
const int func1();
const int
func1
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.

备注

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

Concepts

Declarations