I am writing a program to do some analysis on DNA sequences.
Everything works fine except for this thing.
I want to declare a 2D array of size m*n where m and n are read from an input file.
Now the issue is that if m and n goes too large. As an example if m = 200 and n = 50000
then I get a seg fault at the line where I declare my array.
array[m][n];
Any ideas how to overcome this. I do need such an array as my entire logic depends on how to process this array.
Probably you are running out of stack space.
Can you not allocate the array dynamically on heap using
malloc?You may want to have a look at this answer if you do not know how to do that.