Programming Tools Guide
Chapter 3, C language compiler

Declarators

Declarators

Declarators include:

What follows is a brief summary of the syntax of declarators:
   declarator:
   	pointeropt direct-declarator
   direct-declarator:
   	identifier
   	(declarator)
   	direct-declarator [constant-expressionopt]
   	direct-declarator (parameter-type-list)
   	direct-declarator (identifier-listopt)
   pointer:
   	* type-qualifier-listopt
   	* type-qualifier-listopt pointer



Pointer declarators





Array declarators



An array type of unknown size is known as an incomplete type. 

Function declarators



Examples:

void srand(unsigned int seed);
The function srand returns nothing; it has a single parameter which is an unsigned int. The name seed goes out of scope at the ) and as such serves solely as documentation.

int rand(void);
The function rand returns an int; it has no parameters.

int strcmp(const char *, const char *);
The function strcmp returns an int; it has two parameters, both of which are pointers to character strings that strcmp does not change.

void (*signal(int, void (*)(int)))(int);
The function signal returns a pointer to a function that itself returns nothing and has an int parameter; the function signal has two parameters, the first of which has type int and the second has the same type as signal returns.

int fprintf(FILE *stream, const char *format, . . .);
The function fprintf returns an int; FILE is a typedef name declared in stdio.h; format is a const

note the use of ellipsis ( . . . ) to indicate an unknown number of arguments.