Skip to main content

Questions tagged [pset4recover]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
2 answers
18 views

Problem Set 4 Recover

I have written a solution to CS50's Problem Set 4 Recover, and my code produces all 50 images clearly (to me, at least). However, check50 says that the middle images and last images do not match what ...
usmflor's user avatar
1 vote
1 answer
51 views

Problem Set 4 - Recover (timed out while waiting for program to exit)

After spending almost a week working on the code for the Recover exercise, I have finally made it work. However, when I check with check50, I get the error: :( program is free of memory errors timed ...
Stavros Marinos's user avatar
0 votes
1 answer
57 views

Pset4- recover: recovered jpgs appear to be empty

I tried to implement recover through the simplest and shortest way I could imagine. The code compiles and saves 50 JPGs with proper names, but when I open them, all of them are just empty and even ls -...
Fawz's user avatar
  • 1
0 votes
2 answers
65 views

CHECK50 Passes, but I Get 6/7 When Submitting

I've just completed pset4 - recover. I did quite a bit of debugging and was finally able to pass all checkmarks with check50, style50 and Valgrind. After submitting I checked my grade and I received 6/...
csharp1321's user avatar
0 votes
1 answer
91 views

program is free of memory errors

Im about to finish pset4, currently on recover! Everything is ok at the first look, program compiles, however, there is a problem when I run check50. As you can see from the title, something is off ...
liza's user avatar
  • 13
0 votes
1 answer
32 views

i am unable to open my cs50 card.raw file

#include <stdio.h> #include <stdlib.h> int main(int argc, char *argv[]) { //open memory card FILE *memorycard = fopen("card.raw","r"); if (memorycard =...
Gold Isaac's user avatar
0 votes
0 answers
23 views

program in recover pset4, please help me find the errors and if you could add how to debug the code, its will be helpful

#include <stdio.h> #include <stdlib.h> #include <stdint.h> typedef uint8_t BYTE; int main(int argc, char *argv[]) { if (argc != 2) { printf("./usage: recover filename\n"); ...
Trex Vanga's user avatar
0 votes
1 answer
58 views

in pset4, recover, why is the first jpg found treated differently from the other jpg files?

I'm starting to work on pset4, recover, and (as you can tell) things are not going well. I read posts from other students working on the same problem and realize some of them check for the jpg header ...
Alvaro Barboza's user avatar
0 votes
1 answer
13 views

Pset 4 recover- sprintf format striing error

I have been on recover for a while now,and I am recieving an error when compiling the code: recover.c:31:42: error: data argument not used by format string [-Werror,-Wformat-extra-args] sprintf(...
Robbie's user avatar
  • 5
1 vote
1 answer
49 views

Why does the 0.49 jpg file doesn't match correctly?

I'm doint the recover PSET04. I think, I've done everything correct expect of the 0.49 jpg file. It says that it doesn't match correctly. And the last error in Check50 is "can't check until a ...
AlvaroAndLukeTheCoder's user avatar
0 votes
1 answer
30 views

P4 Recovers only first 512 bytes

im really struggling with this one and your help would be really appreciated My code is working quite good but theres a error with writing file wich i cannot fix // i will start with line where i ...
Marek Pecnik's user avatar
0 votes
1 answer
38 views

PS4 - Recover - expected exit code 0, not 139

my program works well, images are created correctly. But when I make check50 i get this strange error expected exit code 0, not 139 :) recover.c exists. :) recover.c compiles. :) handles lack of ...
Black Beard's user avatar
0 votes
1 answer
48 views

pSet4: Recover Memory Leaking after opening a file

When I try to run my solution to recover in cs50 problem set 4, I get a segmentation fault. I tried to use check50, and I got a poor response for memory leaks. :( program is free of memory errors ...
Team's user avatar
  • 5
0 votes
1 answer
40 views

Week 4 - Recover

All of the first 49 images get recovered fine except the last one. I have went through the code a lot, but still can't find the problem. #include <stdio.h> #include <stdlib.h> #include <...
Sin's user avatar
  • 1
0 votes
1 answer
57 views

Code for Good ol' Recover returns all fifty images (000-049), but doesn't pass Check50

I have gone through about 12 questions on the same issue - the code for recover works, but check50 isn't being kind: :) recover.c exists. :) recover.c compiles. :) handles lack of forensic image :) ...
Hamster1303's user avatar
0 votes
1 answer
20 views

pset4 recover- can't match

I'm having problem with my pset 4 recover assignment, my code can compile and produce 49 jpg documents with the right name, but check50 told me they don't match with the right jpgs. Is there anything ...
Eva Chen's user avatar
0 votes
1 answer
17 views

Weird question about PSET4 recover

I've encoutered a weird bug in recover.c the following is my code and an error occurs at the last part. recover.c:65:5: error: type specifier missing, defaults to 'int' [-Werror,-Wimplicit-int] fclose(...
Eva Chen's user avatar
0 votes
1 answer
51 views

PSET4 Recover segmentation fault

Good afternoon/morning, I'm having problem with Problem set 4 Recover, My code can compile but Segmentation fault (core dumped) keeps going out, I checked on debug50 and it seems the segfault occurs ...
Eva Chen's user avatar
0 votes
1 answer
1k views

CS50 Problem Set 4: Recover

I am getting a 'Segmentation fault (core dumped) error' I know that means I am accessing memory I shouldn't. I feel like it has something to do with my fread or fwrite functions. ''' #include <...
ManveerD's user avatar
0 votes
1 answer
30 views

PS4: Recover - Code recovers all 50 images perfectly but fails check50. help pls :(

#include <stdio.h> #include <stdlib.h> #include <stdint.h> #include <inttypes.h> int main(int argc, char *argv[]) { typedef uint8_t BYTE; FILE *outptr = NULL; //...
Anthony Jackson's user avatar
0 votes
1 answer
367 views

RECOVER, can't see images

I've been working on recover for days now. I've been able to solve the segmentation fault issues and the code compiles and creates all 50 jpg files, but doesn't write the files correctly. I played ...
Alvaro Barboza's user avatar
1 vote
1 answer
169 views

Can not find jpeg..recover problem from cs50 pset4

so I was trying to solve this recover problem from cs50.IT compiles well but it shows me this following problem :) recover.c exists. :) recover.c compiles. :) handles lack of forensic image :( ...
Fayek Ahmed Rahat's user avatar
0 votes
1 answer
548 views

Understanding Pset4 Recover Valgrind Errors

My code for Recover is passing all the tests in Check50 except for the final one on memory errors. When I run valgrind ./recover I get this: When I look into the details of why I'm not passing ...
getsendy's user avatar
0 votes
1 answer
26 views

PSET4 Recover.c Want to understand If statement

My code only works if I separate the two if statements instead of nesting the highlighted if statement within the outer one though I don't understand why. The results are:
padfoot13's user avatar
0 votes
1 answer
104 views

pset4 recover error segmentation fault

Can i please get some help with my recover code? i have rewritten it so many times but i still get a segmentation fault i even unmalloc'd a few things but to no avail // recovers deleted images #...
jeddah's user avatar
  • 5
1 vote
1 answer
31 views

pset4 recover segmentation fault on code that compiles, I have looked many questions related to the problem but no luck so far

#include <stdio.h> #include <stdlib.h> #include <stdint.h> #include <cs50.h> typedef uint8_t BYTE; const int BLOCK_SIZE = 512; int main(int argc, char *argv[]) { if (argc != 2)...
turanzela's user avatar
0 votes
1 answer
32 views

Recover: Encountering many problems

My code compiles fine, but no jpg files are created. It seems like the condition that checks for the start of a jpg is never true, so the body of that if condition never executes. I'm also having ...
khalildouis's user avatar
0 votes
1 answer
25 views

Recover code runs but doesn't generate any jpegs

at sure I didn't know how to even begin, but slowly started realizing how i can tackle this problem. after a bit i was stuck on how some stuff works so i looked up some recover tutorials that helped ...
mohammed qadi's user avatar
0 votes
1 answer
67 views

Code compiles but files are not read. Recover pset4

Trying to find the problem i could track it to the else statement where ""printf("Could not open file because NULL.\n");"" is located. The files are not read at all or ...
Francisco Azocar's user avatar
0 votes
1 answer
52 views

pset4 recover doesn't recognize jpegs

I've been working on Recover for quite many hours now and I can't really understand what is wrong. Here I share my commented code. What I can tell you about its behavior is the following: It does not ...
nico_so's user avatar
0 votes
1 answer
70 views

pset 4 recover, I can compile but no JPEGs returned

#include <stdio.h> #include <stdlib.h> #include <stdint.h> #include <string.h> typedef uint8_t BYTE; int main(int argc, char *argv[]) { if(argc > 2 || argc < 2) ...
anonymous's user avatar
0 votes
1 answer
97 views

CS50 PSET4 recover Segmentation Fault

Can someone point out why this code is resulting in segmentation fault? It's a code for the 'recover' question in pset4, cs50. #include <stdio.h> #include <stdlib.h> #include <stdint.h&...
Eyvie's user avatar
  • 3
0 votes
1 answer
57 views

Pset4 recover produces only 2 corrupted iamges

I am at Pset4 recover pset. When I run my code, it produces only 2 corrupted images here is my code : #include <stdio.h> #include <stdlib.h> #include <stdint.h> typedef uint8_t BYTE;...
Ahmed Elbessfy's user avatar
0 votes
1 answer
510 views

PSET4 Recover error: incompatible integer to pointer conversion passing 'int' to parameter of type 'const char *

I am at PSet4-recover. I can't compile code properly. Always get these errors : recover.c:47:31: error: incompatible integer to pointer conversion passing 'int' to parameter of type 'const char *' [-...
Ahmed Elbessfy's user avatar
0 votes
1 answer
204 views

(PSET 4 - Recover) Why is first recovered image blank?

I am on problem set 4 recover and I have nearly completed it. I have written my code and it compiles but when I run it on the card.raw file it appears to recover all the 50 photos except the 1st one ...
Dre Johnson's user avatar
0 votes
1 answer
68 views

CS50 Recover recovering corrupted images, and only 43 images

I'm attempting to solve the Recover problem, and I'm using a for loop to go through the bytes of the raw file. It spits out 43 images, some of which have the full image, but most are corrupted, and ...
Daniel Chettiar's user avatar
0 votes
1 answer
50 views

PSET4 RECOVERY does not recover images correctly

I have started working on PSET 4 RECOVERY. My program compiles successfully, it goes through the first 3 tests no problem, but for the love of me I cannot seem to find the problem. It just does not ...
TheSimpathizer's user avatar
0 votes
1 answer
49 views

Where am I mystaking ? pset4-RECOVER

I've been rewriting that code for about a week now and start beeing very confused about what I am doing wrong, I hope my logic isn't fully wrong but I have some doubts about my understanding of ...
Pierre Catala's user avatar
0 votes
1 answer
32 views

In Recover, when I run check50, it says timed out while waiting for program to exit. But when I run it with ./recover card.raw, it works perfectly

#include <stdio.h> #include <stdlib.h> #include <stdint.h> typedef uint8_t BYTE; int check_jpg(BYTE array[]); int main(int argc, char *argv[]) { if(argc != 2) { ...
Sachit Bansal's user avatar
0 votes
1 answer
45 views

pset 4 Recover: Segmentation Fault in If-else-statement

I am trying to solve why I get a segmentation fault in my code "recover". It's right at the end of the file. I solved the pset4 by trying different solutions. However, I don't understand why ...
user avatar
0 votes
1 answer
173 views

Why can't I assign the return value of a fwrite() function to another variable? Infinite loop

In 'recover' I wanted to jump out of my while loop if the fwrite() function of the last photo (of the file) returns a value < 512 (indicating that the last photo or end of file is reached). I ...
c_dinosaur's user avatar
0 votes
1 answer
635 views

cs50 2021 pset4 recover help

EDIT: Ok after trying for 3 hours after posting this I have finally managed to solve this pset. The problem wasn't actually a logical one but rather it was a problem with the type definition and the ...
Amos Ting's user avatar
0 votes
1 answer
21 views

Segmentation Fault in recover.c

I keep getting a segmentation fault in my recover.c and I am not sure why. I have been stuck on this one for days. The idea is that we are trying to recover some deleted jpg files from a card. Thank ...
Summer Ng's user avatar
0 votes
1 answer
320 views

Need Help with using malloc and PSET4 Recover

I cannot tell what's wrong with my code. When using check50 I keep getting the results below: :) recover.c exists. :) recover.c compiles. :) handles lack of forensic image :( recovers 000.jpg ...
benjabit's user avatar
0 votes
1 answer
44 views

buffer array full of \000, pset 4 recover segfault

I am experienceing a problem where nothing is beign read into a buffer array, but for the life of me I am unable to figure out why. I have read through other threads with users experiencing the same ...
Bob Tan's user avatar
0 votes
1 answer
45 views

Why does `size` = `0` occur?

I've been trying PSet4's Recover. I've been trying to obtain the size of the entered file (card.raw) but unfortunately size gives and output of 0. Here's the code that I've made to find the file's ...
MelPradeep's user avatar
0 votes
1 answer
185 views

Recover.c - Code Creates JPG files but it doesn't doesn't match expected output

#include <stdio.h> #include <stdint.h> #include <stdlib.h> typedef uint8_t BYTE; int main(int argc, char *argv[]) { //user didn't enter one argument or enters more than one if (argc &...
Mazen's user avatar
  • 5
0 votes
1 answer
53 views

not recovering any JPEGs though the code works

can someone tell me what is wrong with my code it works and recovers but no images are found upon checking :) recover.c exists. :) recover.c compiles. :) handles lack of forensic image :( recovers 000....
YoussefSaeed's user avatar
0 votes
1 answer
60 views

PSET 4 Recover.c - Segmentation fault

The code compiles perfectly. However, it triggers a segmentation fault which I imagine is due to a wrong use of pointers. This is the code: #include <stdio.h> #include <stdlib.h> #...
Jaime's user avatar
  • 15
0 votes
1 answer
28 views

Why is my recover code not giving any output?

I'm very confused why this code is not giving any output: Code: #include <stdio.h> #include <stdlib.h> #include <stdint.h> typedef uint8_t BYTE; long int findSize(char file_name[]) ...
user avatar