One , The local array is too large . When the array inside the function is too large , May cause stack overflow .

for example :

#include <stdio.h> #define SIZE 1 * 1024 * 1024 int main() { int b[SIZE]; int
i; for(i = 0; i < SIZE; ++i){ b[i] = i; } for(i = 0; i < SIZE; ++i){
printf("%d", b[i]); } return 0; }
Two , Too many levels of recursive calls . Recursive functions perform stack pushing operations at run time , When the stack is pressed too many times , It can also cause a stack overflow .

#include <stdio.h> int Sum(const unsigned int n) { printf("now n is %u\n", n);
if(0 == n || 1 == n){ return n; } return n + Sum(n - 1); } int main() {
unsigned int n; printf("Input n: "); scanf("%d", &n); printf("The sum of 1 to
%u is %u\n", n, Sum(n)); return 0; }
Three , Pointer or array out of bounds . This is the most common situation , For example, copy strings , Or processing user input, etc .

Four , There is no garbage collection .

Technology
©2019-2020 Toolsou All rights reserved,
Final review of database : Summary of comprehensive application questions Laplance operator ( Second derivative ) Simple learning of computer composition principle pyqt Button call python program _PyQt: Link button to function in program How much can you go up once you change jobs ? Today, I saw the ceiling of job hopping python in str Function usage _python in str Usage Summary of built-in functions MySQL trigger web The server nginx---linux Installation and deployment C++ Chapter V polymorphism exercises :( It's coming to an end )python Check built-in functions , How to check python Built in function