my problem is as follows:
This code returns a seg fault (core dumped):
#include <stdio.h>
int main(void) {
double array[128][128][128];
printf("done");
return 1;
}
while this code is ok:
#include <stdio.h>
double array[128][128][128];
int main(void) {
printf("done");
return 1;
}
Of course is a problem of memory, because if I put inside the main function the declaration:
float array[127][128][128];
the code works well. On the other hand, if I use "malloc" for allocating the cube inside the main function, the code works well also. I can not understand the reason for that. There is a simple explanation?
Thanks