using floats in functional prototypes

Karl Heuer karl at haddock.ima.isc.com
Fri Jan 27 10:22:03 AEST 1989


In article <942 at ubu.warwick.UUCP> geoff at emerald.UUCP (Geoff Rimmer) writes:
>...  Finally, if you want to do a function prototype for a function with no
>arguments (e.g. main() in your example), the PROTOTYPE should have 'void'
>between the parentheses, but the DEFINITION shouldn't:

I see no reason to make such an exception.  If you've got prototypes, use
them for both declarations and defintions, whether or not the function takes a
positive number of arguments.  In particular,
	int main(void) { return 0; }
is perfectly correct.  The old style (without `void') is obsolescent.

Karl W. Z. Heuer (ima!haddock!karl or karl at haddock.isc.com), The Walking Lint



More information about the Comp.lang.c mailing list