Questions tagged [fclose]
The fclose tag has no usage guidance.
5 questions
0
votes
1
answer
99
views
CS50 Problem Set 4 - Recover, fclose undeclared identifier issue
My first time posting on the forum so hope someone can help. I've been scratching my head over this code for a while now and can't understand why I get the undeclared identifier! My code seems to ...
1
vote
1
answer
118
views
Pset4 Recover: Not understanding where to put the forever loop to break out and close the image file
My code for recover.c works except for 015.jpg. I can see the image in the folder, but the file is not closing correctly and thus disrupting check50.
I get that I want to put a "forever loop" ...
0
votes
1
answer
166
views
recover segmentation fault fclose
I need your help again. Something wrong with my fclose in both cases (as valgrind said). The program compiles, but it has segmentation fault and doesn't create jpgs. Here is the code (sorry for ...
1
vote
1
answer
2k
views
Correct use of fopen, fclose, file pointers
I found this problem while working on recover.c. My program recovers all the image files, check50 says everything's cool, but when I run Valgrind, it gives me a ton of errors. After some tests, I ...
1
vote
1
answer
377
views
Recover.c Segmentation Fault
Pseudocode:
declare counter
declare filename[8]
main
Open input
Declare buffer
do
read(512 bytes into buffer from input)
while (not start of jpeg)
do
write filename
open ...