Search code examples
c++debuggingvisual-c++g++stack-overflow

Can you give an example of stack overflow in C++?


Can you give an example of stack overflow in C++?


Solution

  • The typical case that does not involve infinite recursion is declaring an automatic variable on the stack that is too large. For example:

    int foo()
    {
        int array[1000000];
    
    }