Path: utzoo!utgpu!attcan!uunet!lll-winken!lll-tis!ames!pasteur!ucbvax!decwrl!adobe!steel!burgett
From: burgett@steel.COM (Michael Burgett)
Newsgroups: comp.lang.c
Subject: Re: Syntax of function prototypes...
Message-ID: <4165@adobe.COM>
Date: 19 Aug 88 13:50:07 GMT
References: <8808171403.AA05181@ucbvax.Berkeley.EDU> <6105@venera.isi.edu> <871@buengc.BU.EDU>
Sender: news@adobe.COM
Reply-To: burgett@steel.UUCP (Michael Burgett)
Organization: Adobe Systems Incorporated, Mountain View
Lines: 27

In article <871@buengc.BU.EDU> bph@buengc.bu.edu (Blair P. Houghton) writes:
>>
>>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)?
>
yes you're missing something.  By function prototyping you have to declare the
type and number (or indicate that there is a variable number) of parameters
so that the compiler can play lint and check all usage of the function calls
throughout your code.  What you list indicates that "something" is a function
returning an int, but nothing else.  If this is used with ANSI I believe the 
compiler will look at the first time you use a function to determine the 
arguments...

		mike burgett

				burgett!adobe@decwrl.dec.com