Questions tagged [pset4recover]

The tag has no usage guidance.

30 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
1
vote
1answer
21 views

CS50 recover (fclose giving segmentation fault)

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 ...
0
votes
0answers
7 views

Recover not working Pset4

int main(int argc, char *argv[]) { // file opened FILE *file = fopen(argv[1], "r"); // user types two inputs if (argc != 2) { return 1; } // ensuring it is a valid file if (file == NULL) { ...
0
votes
1answer
22 views

Pset4 Recover Segmentation Error. Valgrind unable to find anything

I'm sorry to bring about yet another segmentation fault but I cannot for the life in me find the error (Even valgrind is kinda malfunctioning). Here's my code- #include <stdio.h> #include <...
0
votes
0answers
23 views

Recover, almost there… images doesn’t show correctly

I think I'm very close to getting this one right, but I've been trying different codes with the same results so I think my logic must be wrong. This code finds correctly the jpegs and creates the ...
0
votes
1answer
34 views

pset4 - can't figure out what i'm doing wrong - recover

This is the code: #include <stdio.h> #include <stdlib.h> int main(int argc, char *argv[]) { if (argc != 2) { return 1; } FILE *file = fopen(argv[1], "r&...
0
votes
0answers
34 views

Recover.c fprintf failing on the 35th file

So on the recover.c program, my program works to recover the first 34 images, but it segfaults on the 35th. I've determined that it has to do with the fprintf function, but it worked the first 34 ...
0
votes
1answer
17 views

Pset4 recover code only shows parts of the picture

I've worked on the code and gotten it to the point where it recovers all 50 images. However, the images only display parts, usually starting in the top left corner. This is my current code. Can ...
0
votes
0answers
35 views

For pset4/recover i keep getting an error despite the pictures recovering when i run the program

could someone please identify whats wrong with my code. im a beginner and completely lost.
0
votes
1answer
30 views

pset4 recover only recovers 25 correct images

This is my code for recover. When I run the program, it gives me 25 successfully recovered photos. I don't know why it is only giving me half the required photos. I believe it might have something to ...
0
votes
1answer
60 views

PSET4, RECOVER: Segmentation Fault

I have been trying to solve RECOVER from PSET4 and I keep getting a segmentation fault. Any ideas on why this happens? #include <stdio.h> #include <stdlib.h> #include <stdint.h> ...
0
votes
1answer
26 views

recover compiles but has segmentation fault when running it with ./recover card.raw, could anyone take a look

#include <stdio.h> #include <stdlib.h> #include <cs50.h> int main(int argc, char *argv[]) { //this counter to keep track of how many jpegs found so far int counter = 0; //allocate a ...
0
votes
0answers
26 views

Segfault error, please help

I really need help, I'm getting a segfault error. Please look through my code and help me, please. #include <stdio.h> #include <stdlib.h> #include <stdint.h> int main(int argc, char ...
0
votes
1answer
90 views

CS50/PSET4/RECOVER- Error- “Can't open card.raw: file format unsupported”

Keep getting "Can't open card.raw: file format unsupported" error when running the code. Not sure what I'm doing wrong. #include <stdio.h> #include <stdlib.h> int main(int argc, char *...
0
votes
1answer
45 views

CS50 PSet 4 Recover, Segmentation Fault

My code compiles, but whenever I run Check50, I get a segmentation fault error for each category. Would definitely appreciate any help identifying where the problem can be fixed! #include <stdio.h&...
0
votes
2answers
103 views

Why does my Cs50 recover programme correctly recover all images except the first one?

I wrote the below code and it recovers 51 images: 000.jpg to 050.jpg- all images except img 000 seem to have been found correctly. I'm not sure why the code isn't working? include include include ...
0
votes
0answers
26 views

Recover: when using fread it is storing \000 instead of 512 different bytes?

I am new to coding and struggling with the recover task. I am wanting to read the first 512 bytes from the file "card" and place them into a buffer. I've tried this: unsigned char buffer[512]; ...
0
votes
1answer
17 views

pset4 reError interpreting JPEG image file (Not a JPEG file: starts with 0x62 0x74)

below will be my code. on check50 I get: :( recovers 000.jpg correctly recovered image does not match :( recovers middle images correctly recovered image does not match :( recovers 049.jpg ...
0
votes
1answer
38 views

PSET4 Recover - Code gets stuck at if statement

I'm working on the recover problem, but when my code gets to the if statement I made that checks for the header of a JPEG file, it gets stuck. I get no errors, it simply stops iterating through the ...
0
votes
0answers
25 views

CS 50 Recover, Genrating blurred or pixalated images!

I have been stuck at this code for quiet a while now and i am finally able to generate all the images but the images are pixalated and not correct . I have seen online as why this might happen and ...
0
votes
2answers
58 views

PSET4 Recover: Segmentation fault

I am receiving a segmentation fault stemming from line 95. This is where I am attempting to continue to write the remainder of a JPG file after finding it. [code hidden]
0
votes
1answer
88 views

Pset4 Recover issues

I am having a number of problems with recover in pset4. First, my program is not finding a beginning of a jpeg. But, to test that, I have to first compile it, and I cannot because for some reason on ...
0
votes
1answer
30 views

My latest two problems aren't being scored

I submitted one of my problem sets and I'm unable to get my problem scored. screenshots:
0
votes
0answers
77 views

PSET4 RECOVER. I can get all 49 images. But i cannot pass check 50. The error say my code cannot compile, and that returns 1 instead of 0

int main (int argc ,char * argv[]) { if (argc!=2) { fprintf ( stderr, "one argument only. which file would you like to recover ?"); return 1; } //save the filename ...
0
votes
1answer
423 views

recover.c “ recovered image does not match”

My program generated the 50 images (000 to 049) from the card.raw file. When I opened each one, it was just a checkered (which i assume is blank) image. I'm not getting a "unsupported image" error btw....
0
votes
1answer
63 views

Recover - error message when I test it : The file won t open to copy inside

I m struggling. Can't find why I have this error message :~/workspace/pset4/recover/ $ ./recover card.raw Could not open new file. Here is my code : //define data ...
0
votes
1answer
192 views

pset4 recover.c segmentation fault fread/fwrite

I am trying to complete recover.c for pset4, but I am having major trouble debugging. I get a segmentation fault after the first fwrite step has occured, and it creates the fault at the fread step at ...
0
votes
1answer
63 views

pset4 recover: too many JPEGs found

guys! I was solving recover, but my program finds way too many JPEGs. I believe that this is because of the following lines: // starting bytes of jpeg are in [lower, upper] uint8_t lower[4] = {0xff, ...
0
votes
0answers
61 views

Having Trouble correctly reading bytes for pset4 recover

I've just started pset4 recover, and I wanted to make sure certain parts of the program would work well independently before I put it all together. So I started by making sure my program could ...
0
votes
0answers
27 views

PSET4: Recover error

#include<cs50.h> #include<stdio.h> int main(int argc, string argv[]) { if(argc!=2) { fprintf(stderr,"Usage: ./recover file_name\n"); return 1; } FILE *...
0
votes
1answer
34 views

pset4 Recover “grade”

I recently submitted my Pset4 Recover project to the new grading Bot....and received 0 of 100.....despite the fact that my program returns all 50 photos....reaches the EOF .....Valgrind shows 0 ...