yes that work. thanks. I have a different problem now ( I have been working on the problem continuously so sorry, if it seems like I am asking too many questions).
Previously I did as is shown in the link.
Code:
double **array1 = malloc(5000 * sizeof(double ));
for(i = 0; i < 5000; i++)
array1[i] = malloc(5000 * sizeof(double));
and I get array1[5000][5000] as desired. Now I have to use array1 in a struct as follows.
Code:
struct solution { int ell;
double array[5000][5000];
};
// now define 1200 of these structs
struct solution *my_Sol;
// doing the following return a NULL pointer. I am guessing there is no single
// block of memory that big. I'd have to allocate smaller blocks like above
// but the problem is the technique for 2d arrays deals with a single data type
my_Sol = malloc(sizeof(struct solution) * 1200)) //does not work
//nor does the following
int ell;
for (ell = 0; ell < 1200; ell++)
{
my_Sol[ell] =malloc(sizeof(struct solution));
}
How should I approach the problem?
System Monitor shows that I am using 46% of 1.9GiB right now.