Possible Duplicates:
restrictions on the main() function
Is it legal to recurse into main() in C++?
I read in C++ Primer that main
is not allowed to be called recursively, and in some related questions here on SO it is indeed confirmed that it is illegal.
But why is it illegal? As long as you avoid a stack overflow, what's the problem with calling main
within itself?