In a function definition, each parameter
must have an identifier. In a function declaration,
or prototype, specifying an identifier is optional. Thus, the following
example is legal in a function declaration:
int func(int,long);
C++ only
The following constraints apply to the use of parameter names in
function declarations:
Two parameters cannot have the same name within a single declaration.
If a parameter name is the same as a name outside the function,
the name outside the function is hidden and cannot be used in the
parameter declaration. In the following example, the third parameter
name intersects is meant to have enumeration type subway_line,
but this name is hidden by the name of the first parameter. The declaration
of the function subway() causes a compile-time error because subway_line is
not a valid type name because the first parameter name subway_line hides
the namespace scope enum type and cannot be used again
in the second parameter.
enum subway_line {yonge,
university, spadina, bloor};
int subway(char * subway_line, int stations,
subway_line intersects);