Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options answers only not deleted user 1707

recover.c, one of the assignments for Problem Set 4, will challenge you to search through the raw bytes of a camera's digital memory to recover a bunch of "deleted" JPEG images.

3 votes

recover.c how to find beginning of next jpeg

You have two questions here: 1. Now I don't know how to tell the program to stop at the next such block. According to the problem set specification, the program needs to read the data in blocks of …
Luke Van In's user avatar
  • 2,655
2 votes

Seg Fault in Recover.c

The error from valgrind is showing you where the crash is occurring, and what the potential cause could be. Here's how to interpret it: Invalid read of size 4 This means the program tried to access …
Luke Van In's user avatar
  • 2,655
3 votes

Pset 5 - Recover

check50 is extremely literal in the way it checks your results. The results need to match it's expected answers exactly, any small difference will result in a fail. Fortunately the error report is o …
Luke Van In's user avatar
  • 2,655
1 vote
Accepted

Can anyone tell why is this giving me a SEGFAULT?

The SEGFAULT is because the code is not passing the correct pointer value to fread: fread(&block, sizeof(block), 1, memcard); Here block is already a pointer. So what this line of code is doing, …
Luke Van In's user avatar
  • 2,655