I have a piece of code that has many variables declared like
abc[1024][1024][10];
Now, i want to increase the size of all these variables to
abc[2048][2048][10];
but, whien i compile and run the program, I am getting a segmentation fault. I believe this is beacuse, it is running out of memory.
I want to make it so that it allocates memory dynamically.
How do I go about doing it?? and how do i allocate memory?? use a realloc??
abc[1024][1024][10];
Now, i want to increase the size of all these variables to
abc[2048][2048][10];
but, whien i compile and run the program, I am getting a segmentation fault. I believe this is beacuse, it is running out of memory.
I want to make it so that it allocates memory dynamically.
How do I go about doing it?? and how do i allocate memory?? use a realloc??