I would like some help with recover, after few days of struggle I managed tp finish pset4 recovering all 50 images from file but when i run the cs50 check test it gives me this error
$ check50 2015.fall.pset4.recover recover.c
:) recover.c exists
:) recover.c compiles
:( recovers 000.jpg correctly
\ expected an exit code of 0, not standard error of "/opt/sandbox50/bin/run.sh: line 31: 235..."
:( recovers middle files correctly
\ expected an exit code of 0, not standard error of "/opt/sandbox50/bin/run.sh: line 31: 235..."
:( recovers last file correctly
\ expected an exit code of 0, not standard error of "/opt/sandbox50/bin/run.sh: line 31: 236..."
https://sandbox.cs50.net/checks/4804c3b5146448b2bc4b48464c9bc88f
here you can find a link off my code
Thank you in advance!!!
Hello again, that really worked I added an if condition in the begining of code to create an title for the jpg file so i wont get SEGF error
if(index > 0)
{
sprintf(title,"%03i.jpg", index - 1);
}
else if (index == 0)
{
sprintf(title,"%03i.jpg", index);
}
and moved fclose(img) from if condition to the end of while so it can be closed each time.
That worked perfectly :). Thank you!!!!