main() arguments, was Re: typedef-ing an array

Stephen Clamage steve at taumet.com
Thu Jul 5 02:56:30 AEST 1990


In article <4241 at jato.Jpl.Nasa.Gov> kaleb at mars.UUCP (Kaleb Keithley) writes:
>In article <25273 at mimsy.umd.edu> chris at mimsy.umd.edu (Chris Torek) writes:
>-to write a portable program, you must not use this invisible third argument.
>
>Can you quote a reference to this assertion?

ANSI C standard, section 2.1.2.2, says that main may be declared with
zero or two arguments.  Period.

If you write main() with one or three or more arguments, it does not
conform to the standard, and any conforming compiler is free to reject it
as an error.  A conforming compiler MAY allow additional arguments as an
extension, but need not.
-- 

Steve Clamage, TauMetric Corp, steve at taumet.com



More information about the Comp.lang.c mailing list