Hi, thanks for reading. This is my first post so I hope I used the tags right.
The problem is simple. I need to use huge arrays and to get arguments from the command line, however, when I try to use both at the same time I get a segmentation fault.
This is the code I'm using
Code:
#include <stdio.h>
#include <stdlib.h>
#define DIMR 1024
#define DIMANG 50
#define DIML 8
int main(int argc, char *argv[]){
double psi[DIMR][DIMANG], f[DIMR][DIML+1], g[DIMR][DIML+1], g_op_fact[DIMR], f_op_fact[DIMR][DIML+1], g_update_fact[DIMR][DIMR], f_update_fact[DIMR][DIMR];
return 0;
}
when I change "int main(int argc, char *argv[])" to "int main()", the segmentation fault goes away. Also, if use not so big arrays (#define DIMR 512) with "int main(int argc, char *argv[])" the segmentation fault disappears.
I don't really have a clue about how to fix this. Any help would be much appreciated
PS: I have 3Gb of RAM.