Xref: utzoo comp.lang.c++:10648 comp.std.c:4001 comp.std.c++:463 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!uunet!taumet!steve From: steve@taumet.com (Stephen Clamage) Newsgroups: comp.lang.c++,comp.std.c,comp.std.c++ Subject: Re: calling main in ANSI C Keywords: main standard Message-ID: <535@taumet.com> Date: 3 Dec 90 05:47:08 GMT References: <814@atcmpe.atcmp.nl> Followup-To: comp.lang.c++ Organization: Taumetric Corporation, San Diego Lines: 14 leo@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@taumet.com Brought to you by Super Global Mega Corp .com