I am trying to find the best and most efficient way to do this. What I am doing will be loading an image, like a bitmap, into memory. I don't know the size of it, so I would like to dynamically allocate the space, no hard coding array sizes.
From there, I will take the data (i assume probably from a char** buffer?) and will put it into some structs.
The main thing is, I will be loading the bitmap into memory, and I don't want to use any more space than needed. I will be running some operations on the pixel data and such.
I am guessing with the use of malloc and a char**, I will be able to make a char array that will be exactly the size of the byte content of the graphic to be imported.
If you could post either some small snippets, or if you want me to write some pseudocode (not sure if I explained myself well enough), just let me know.
any help appreciated!