Followup) Computers:Programming:Languages->"easy one"

In the locked question "easy one" under the group "Computers:Programming:Languages", somebody makes the point that you can NOT call "main()" recursively in C++ (only in C) and another contests this point.  

Calling "main()" recursively under SunPro CC 4.2 and 5.0 fails, but succeeds under g++ 2.8.1.  It supposedly works in Visual C++.

I tried to find a reference to "main()" and "recursive" in Stroustrup 3rd Edition and in Schildt 3rd Edition, and had no luck.

I do not have a copy of the standard.  Just wondering if anyone knew if the standard prohbits the recursive calling of main()?
barrycAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

nietodCommented:
I'll look into it.  But I don't remember any restriction against it.
0
nietodCommented:
Wow.  I didn't remember it, but i definitely read the section that it came from.  Not it is not allowed to be called.


The function main() shall not be called from within a program. The linkage (3.5) of main() is implementation-defined. The address of main() shall not be taken and main() shall not be declared inline or static. The name main is not otherwise reserved. [ Example: member functions, classes, and enumerations can be called main, as can entities in other namespaces. ]


0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
nietodCommented:
>> I do not have a copy of the standard.

The copy I use is at

http://www.cygnus.com/misc/wp/

This is the final _draft_ version.  The final version is not available for free, but can be downloaded for about $15.  (a printed copy is like $300).  However the draft standard is extremely close to the final standard, so I don't think its worth the money.

Of course, this will probably cost me a lot of points...   : - )
0
barrycAuthor Commented:
Thanks nietod!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C++

From novice to tech pro — start learning today.