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,
hive compress &&hdfs Merge small files I've been drinking soft water for three years ? What is the use of soft water and water softener 《 League of Heroes 》 Mobile game open public test : support iOS/Android Dual platform The situation of receiving and receiving multi-path VaR - Value at risk - Monte Carlo method - Pythonnumpy: The creation of multidimensional array uniapp Summary of page value transfer use C Language makes a very simple airplane game Docker Container data volume ,DockerfileJavaScript Medium Call and Apply