0

I solved pset 4 recover, but one of the bugs in my program which I removed, I found the code which was causing the problem but I don't know why it was.

At the end of my program I was freeing up memory, which included

free(img);

img was a pointer to the file.

When this was in my program, the last photo got an extra few rows of chequered grey and dark grey squares, which caused my program to fail the test for the last image.

When I removed it from my program, this bug went away.

Why was this the case?

You must log in to answer this question.

Browse other questions tagged .