Syntax of function prototypes...

Blair P. Houghton bph at buengc.BU.EDU
Fri Aug 19 18:14:19 AEST 1988


In article <6105 at venera.isi.edu> lmiller at venera.isi.edu.UUCP (Larry Miller) writes:
>In article <8808171403.AA05181 at ucbvax.Berkeley.EDU> U23405 at UICVM writes:
>>Does anyone know (or know where to find) information about the syntax of
>>function prototypes? For example, is this correct:?
[...]
>>For example, do the variable names in the function declaration have to agree
>>with the variable names in the function definition, etc.?
>
>The variable names do not need to agree; in fact, they are not necessary in
>the function DECLARATION (prototype).  If names are used, they have scope
>only to the end of the declaration.  Any of the following will do,
[...]
>
>definition          int something(int a, float b, char c)
>
>possible prototypes
>	  int something(int a, float b, char c);
>          int something(int n, float x, char c1);
>          int something(int, float, char);

Am I missing something (there _is_ an echo in here; I should have
"am I missing something" mapped to the spacebar...:-) or is

int something();

just as good (for a prototype) (except for the obviously better style
of the above, since they are virtually self-commenting)?

				--Blair



More information about the Comp.lang.c mailing list