Search code examples
c++stack-overflow

Why does stack overflow throw no error in Visual C++?


In Microsoft Visual C++ 2010 I created a program which delibrately causes a stack overflow. When I run the program using "start debugging" an error is thrown when stack overflow occurs. When I run it with "start without debugging" no error is thrown and the program just terminates silently as if it had successfully completed. Could someone explain to me what's going on? Also do any other compilers not throw errors on stack overflow?

(I thought this would be the right place to ask a question about stack overflow.)


Solution

  • C++ won't hold your hand as a managed enviroment does. Having a stack overflow means undefined behaviour.