Path: utzoo!attcan!uunet!husc6!bu-cs!buengc!bph From: bph@buengc.BU.EDU (Blair P. Houghton) Newsgroups: comp.lang.c Subject: Re: Syntax of function prototypes... Message-ID: <871@buengc.BU.EDU> Date: 19 Aug 88 08:14:19 GMT References: <8808171403.AA05181@ucbvax.Berkeley.EDU> <6105@venera.isi.edu> Reply-To: bph@buengc.bu.edu (Blair P. Houghton) Followup-To: comp.lang.c Organization: Boston Univ. Col. of Eng. Lines: 29 In article <6105@venera.isi.edu> lmiller@venera.isi.edu.UUCP (Larry Miller) writes: >In article <8808171403.AA05181@ucbvax.Berkeley.EDU> U23405@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