Questions tagged [pset4recover]
The pset4recover tag has no usage guidance.
152
questions
0
votes
1
answer
42
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 ...
0
votes
1
answer
25
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 =...
0
votes
0
answers
20
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");
...
0
votes
1
answer
47
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 ...
0
votes
1
answer
8
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(...
0
votes
1
answer
36
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 ...
0
votes
1
answer
28
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 ...
0
votes
1
answer
28
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 ...
0
votes
1
answer
36
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
...
0
votes
1
answer
31
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 <...
0
votes
1
answer
49
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
:) ...
0
votes
1
answer
17
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 ...
0
votes
1
answer
8
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(...
0
votes
1
answer
46
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 ...
0
votes
1
answer
940
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 <...
0
votes
1
answer
28
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;
//...
0
votes
1
answer
243
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 ...
1
vote
1
answer
100
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
:( ...
0
votes
1
answer
417
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 ...
0
votes
1
answer
24
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:
0
votes
1
answer
97
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
#...
1
vote
1
answer
29
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)...
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 ...
0
votes
1
answer
23
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 ...
0
votes
1
answer
66
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 ...
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 ...
0
votes
1
answer
69
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)
...
0
votes
1
answer
91
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&...
0
votes
1
answer
56
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;...
0
votes
1
answer
427
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 *' [-...
0
votes
1
answer
163
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 ...
0
votes
1
answer
61
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 ...
0
votes
1
answer
47
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 ...
0
votes
1
answer
48
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 ...
0
votes
1
answer
30
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)
{
...
0
votes
1
answer
39
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 ...
0
votes
1
answer
131
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 ...
0
votes
1
answer
601
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 ...
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 ...
0
votes
1
answer
272
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 ...
0
votes
1
answer
41
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 ...
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 ...
0
votes
1
answer
170
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 &...
0
votes
1
answer
52
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....
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>
#...
0
votes
1
answer
27
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[])
...
0
votes
1
answer
66
views
PSET4 Recover: Check50 shows error
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
typedef char* string;
typedef uint8_t BYTE;
int main(int argc, char *argv[])
{
if (argc != 2)
{
...
0
votes
1
answer
55
views
pset4 recover error - timed out while waiting for program to exit
i am getting a timed out error but don t understand why...?
also i can see all the pictures except the last one (049.jpg) ...
#include <stdio.h>
#include <stdlib.h>
int main(int argc, ...
0
votes
1
answer
78
views
Pset4 Recover Creating Segmentation Fault
Trying to work through Pset4 Recover. Currently getting a segmentation fault and not opening any new jpegs. My logic thinking here was to:
Make sure user submits just 1 command line argument
Open ...
0
votes
1
answer
51
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 <...