calling main in ANSI C

Stephen Clamage steve at taumet.com
Mon Dec 3 16:47:08 AEST 1990


leo at atcmp.nl (!Leo  Willems) writes:

|The ARM (the annotated C++ reference manual), section 3.4 states:
|	"The function main() may not be called from within a program."
|I was looking for the same restriction in ANSI C, but could not find
|any statement in the ANSI C standard (2.1.2.2.1).
|Is C++ different from ANSI C on this point?

Yes.  In ANSI C, main() may be called from anywhere in the program.
In C++, it may not be called, nor may its address be taken.  Some
reasons for this are given in the ARM.
-- 

Steve Clamage, TauMetric Corp, steve at taumet.com



More information about the Comp.std.c mailing list