found a few answers to the segmentation fault issue in CS50 recover while closing the file but I couldn't translate the answers to my issue:

The last part: fclose(f); fclose(img); is resulting into seg fault in my case. I've posted my code below. Please help. Thanks!

[EDIT: Code removed for honor code compliance.]


The problem is not the code. Is it possible that you're running an old version of the code or the executable? Maybe editing one version of the code and compiling another version that isn't getting updates?

Occasionally, the IDE itself can get a little glitchy. Try closing your browser and reopening the IDE and try again.

If this doesn't help, leave a message and we'll try again.

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

You must log in to answer this question.

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