main.c 294 B

12345678910111213
  1. #include <stdio.h>
  2. void overflow(int depth) {
  3. char buffer[1024 * 1024]; // 占用一些栈空间
  4. printf("Recursion depth: %d\n", depth);
  5. overflow(depth + 1); // 递归调用
  6. }
  7. int main() {
  8. overflow(1);
  9. printf("This line will not be printed due to stack overflow.\n");
  10. return 0;
  11. }