What happens when y…
 
Notifications
Clear all

What happens when you call main() inside main() ?

1 Posts
2 Users
1 Likes
476 Views
0
Topic starter

In particularly c++ 🤔 

1 Answer
1

Well, you can call a main() within the main() function ,but you should have a condition that does not call the main() function to terminate the program. Otherwise, the program will never return and run infinitely. It will cause a stack overflow when the stack space is used up.

Share: