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

后端 未结 12 1577
不知归路
不知归路 2020-12-31 18:52

Can you give an example of stack overflow in C++? Other than the recursive case:

void foo() { foo(); }
12条回答
  •  梦毁少年i
    2020-12-31 19:44

    Keep trying to return main until the stack runs out?

    int main(int argc, char **argv)
    {
        return main(argc, argv);
    }
    

提交回复
热议问题