This is a last resort, I've never asked a question here . . . I see all 50 images (I'm assuming that's correct for CS50?) :-) but check50 is saying it has not recovered 000.jpg, 001.jpg, 049.jpg, which I in fact do have. I have a strong sense that it has to do with buffer size or how the files are closing but I just can't see my error. Thank you for any help!

 // Scans a file for JPEGs, creates new files and returns a count of JPEGs recovered 
// includes removed for my formatting deficiencies:cs50.h,stdio.h,stdint.h

int main(int argc, char *argv[])
[EDIT: unrelated code removed for Honor Code compliance]

            // set string for filenames
            char filename[8];
            // set memory for file names
            sprintf(filename, "%03i.jpeg", discovered);

1 Answer 1


Well, it's telling the truth. check50 didn't find any files with filenames like *.jpg in the output. There are 50 files that end in .jpEg but none that end in .jpg.

Just goes to show that you have to pay attention to the little details. Did that head slap hurt much? Welcome to the club! ;-)

If this answers your question, please click on the check mark to accept. Let's keep up on forum maintenance. ;-)

  • Oh. My. God. Three hours of staring. I sent people out of the room. Side note: When I first read your reply, I first thought, "I didn't capitalize the 'E' in jpg, what foolish person would do that?!" Thank you so much. I'm off to repair some relationships. Commented Jun 24, 2018 at 12:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .