Function Declaration Syntax

Syntax

decl-specifiers dname( argument-declaration-list ) cv-mod-listopt

argument-declaration-list :

arg-declaration-list , ...

arg-declaration-list :

argument-declaration
arg-declaration-list , argument-declaration

argument-declaration :

decl-specifiers declarator
decl-specifiers declaratorexpression
decl-specifiers abstract-declaratoropt
decl-specifiers abstract-declaratoroptexpression

The identifier given by dname has the type “cv-mod-list function, taking argument-declaration-list, and returning type decl-specifiers.”

Note that const, volatile, and many of the Microsoft-specific keywords can appear in cv-mod-list and in the declaration of the name. The following example shows two simple function declarations:

char *strchr( char *dest, char *src );
static int atoi( const char *ascnum ) const;

The following syntax explains the details of a function declaration:

Syntax

argument-declaration-list :

arg-declaration-listopt ...opt
arg-declaration-list , ...

arg-declaration-list :

argument-declaration
arg-declaration-list , argument-declaration

argument-declaration :

decl-specifiers declarator
decl-specifiers declarator , expression
decl-specifiers abstract-declaratoropt
decl-specifiers abstract-declaratoropt , expression