memory management

I have two matrices. Because they are two big, there is the problem of stack. What can i do? Do I have to make them in two main file?

Thanks a lot!

1
2
3
4
5
#define X_SIZE 1080
#define Y_SIZE 1920
#define BYTESPERPIXEL 3
unsigned char imageData[X_SIZE_T][Y_SIZE_T][BYTESPERPIXEL];
unsigned char imageDataT[X_SIZE_T][Y_SIZE_T][BYTESPERPIXEL];
Dynamic allocation. Probably better inside a class with an appropriate destructor to clean it.
But I have to use matrix because I need use them read from a file and write to a file in a different size
If you want to read from the file do you want the whole file to br read in the array or just a line .
if just a line then you can reduce the size of the array still if you want this much large size of array then you can use dynamic allocation .
Topic archived. No new replies allowed.