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 not deleted user 12172

The standard edition of Problem Set 4 will move beyond C programming language basics, testing your knowledge of pointers, memory management, file i/o and structs.

2 votes

Pset 4: Whodunit Red to white

I'm not going to spoil the answer for you, but I'll share the line of reasoning that helped me to "get the red out" of the image. Think about this. The hexadecimal RGB representation of black is #000 …
hotwebmatter's user avatar
  • 3,050
1 vote

Pset4 Whodunit: The person is still unrecognisible

Congratulations on "getting the red out" of the image. Now, if you'd like to view the image in 256 shades of gray instead of in pale cyan, you might want to consider what W3Schools has to say about He …
hotwebmatter's user avatar
  • 3,050
1 vote
Accepted

Pset4 Question 0

You are basically correct: BMP supports up to 24-bit (16 million colors) and 256 shades of gray. GIF supports up to 8-bit (256 colors) and 256 shades of gray. JPEG supports 24-bit (16 million colors) …
hotwebmatter's user avatar
  • 3,050
1 vote

Which colours do I manipulate in whodunit pset4?

Google "hexadecimal grayscale values" -- w3schools.com will have the best tip of all, if you think about it for a minute. EDIT: Hexadecimal Colors: Shades of Gray It might seem counter-intuitive, bu …
hotwebmatter's user avatar
  • 3,050
0 votes
Accepted

My program says that "No rule to make target `recover'. Stop."

That's a compiler error, not a code error per se. Make certain that your source code is called recover.c and the source file is in the same current working directory that you are executing the make r …
hotwebmatter's user avatar
  • 3,050
0 votes
Accepted

How do I copy the file small.bmp from my workspace into the ~cs50/pset4 workspace so I can u...

If you are comparing two files in your current working directory, the usage is: ~cs50/pset4/peek foo.bmp bar.bmp where foo.bmp and bar.bmp are files in the current working directory. … This is another way of saying: /home/cs50/pset4/peek /home/ubuntu/workspace/pset4/bmp/foo.bmp /home/ubuntu/workspace/pset4/bmp/bar.bmp Every command that you execute has a full pathname leading to the …
hotwebmatter's user avatar
  • 3,050
2 votes
Accepted

pset4 peek error

You're about to learn about something called endian-ness. Hope this helps!
hotwebmatter's user avatar
  • 3,050
1 vote

pset4 debugger stopping

If you are having problems with the graphical debugger in the CS50 IDE (as I did!) then you should learn to use GDB from the command line, as others have suggested. There are two reasons to do this: i …
hotwebmatter's user avatar
  • 3,050
1 vote
Accepted

Pset4 recover: can't seem to use struct to identify the jpg

You're overthinking this. A struct is not necessary here. Why not try storing your identifiers in an array instead?
hotwebmatter's user avatar
  • 3,050
3 votes
Accepted

Pset4 recover, comparing hex in if statements

@Blauelf is correct: you can't count on char to be an unsigned 8-bit int. However, you can use a typedef to make certain that a BYTE is really a byte. Look at these type definitions, borrowed from b …
hotwebmatter's user avatar
  • 3,050
1 vote
Accepted

Pset4 recover.c compiles, but can't seem to print Jpgs at all

Just to be crystal clear: if (data[3] != 0xe0 || data[3] != 0xe0 || data[3] != 0xe1 || data[3] != 0xe2 || data[3] != 0xe3 || data[3] != 0xe4 || data[3] != 0xe5 || data[3] != 0xe6 || data[3] != 0xe7 | …
hotwebmatter's user avatar
  • 3,050