Hope all is well.
This is probably a stupid question but I am going to ask it anyway.
I have finally finished Recover (PSET4). I initially dynamically allocated an array as follows to store my 512 bytes of data from the memory card:
#define BLOCK 512
BYTE* starter_array = malloc(BLOCK)
if (starter_array==NULL)
{
return 2;
}
Well a (very) long story short I managed to create all the JPEGs but they seemed to be all corrupted as none of them would open. Then I decided to change to a static array using the following:
BYTE starter_array [BLOCK];
and it worked straight away and it passed check50. But why is this the case? Obviously there is a difference between the two but I just figured you could just pass values in and out of both arrays in a similar way.
I can share my full code if you wish also.
If anybody has any suggestions I would love to hear them. Many thanks!