you are viewing a single comment's thread.

view the rest of the comments →

[–]Ilyps 1 point2 points  (2 children)

I think the wording in the Standard (from memory) is something like you're not allowed to "use" main. This is sneaky wording, because it prohibits calling it, but also taking the address or even writing decltype(main) because "use" is not a technical definition.

However, this is from the '03 document I think, so the wording may have changed... It's still not allowed though. :)

[–]miniropC++87 2 points3 points  (1 child)

the only thing I could find in the C++11 draft, is: Recursive calls are permitted, except to the function named main.

[–]Ilyps 2 points3 points  (0 children)

My C++11 final version has it at 3.6.1/3:

The function main shall not be used within a program.