Segmentation error: CS50 recover | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Segmentation error: CS50 recover

Which part of the problem are you working on? copying the block of BYTES and writing to another new file calle NewImage after finding a block containing jpegs What problem are you having? Describe the problem in detail. If appropriate, include any error messages, screenshots, or small snippets of code to describe the issue. (Keeping in mind the course's policy on academic honesty, do not share code that may contain spoilers or solutions): I have used malloc to allocate memory for writing the file names and a bool to carry out the statements. I read through each chunk of BYTES reading through and writing it to the NewImage file that I have created and ending the loop when it reaches the end of the file being read. The code compiles all okay but I get a segmentation error. My part of the code that does these are as follows: **At the end, I free the memory to avoid any segmentation errors too A detailed walkthrough of the program is as follow: https://cs50.harvard.edu/x/2021/psets/4/recover/#:~:text=rm%20recover.zip

19th Apr 2021, 8:19 AM
Raiyan Rabbani
Raiyan Rabbani - avatar
1 Answer
0
I can not find your code in that address. please put your code in your post
18th May 2021, 6:53 PM
Hossein Mohtashami
Hossein Mohtashami - avatar