[Solved] Program working fine for smaller values but throwing Segmentation Fault for bigger values [closed]


When N > 100, h is accessed to an index greater than 100, inside the nested for loop

h[k][i][j]=100;

but h is defined as

double h[2][100][100];

You are going out of bounds for h

If you want N as greater than 100 you need to redefine h or malloc it.

1

solved Program working fine for smaller values but throwing Segmentation Fault for bigger values [closed]