The largest size of 2-D array in C [duplicate]
问题 This question already has an answer here : Segmentation Fault, large arrays (1 answer) Closed 5 years ago . in my C program, when I am taking an array like this int a[100000][100000]; I am getting segmentation fault. Now if I am using array of size less than 1000 * 1000 , like this int a[1000][1000]; I am not getting any problem.In my program I need to use a 10^5 * 10^5 array. What should I do to fix it . 回答1: Dynamically allocate it with malloc . By declaring it statically you use the stack,