Skip to main content
2 votes
Accepted

Pset4 Recovery Produces Corrupt Null Files & Skips An Image

"Ready, fire, aim!" The problem lies here: jpg = fopen(filename, "w"); sprintf(filename, "%03i.jpg", numfound); The sprintf command builds the name of ...
Cliff B's user avatar
  • 69.3k
2 votes
Accepted

Week 2 CRACK: Erratic behavior with NULL '\0' when printing combinations of letters

This is a textbook example of "undefined behaviour". It gives different results on different machines because, well, there's a bug and there is no way to predict when or how it will "work" or fail. ...
DinoCoderSaurus's user avatar
1 vote
Accepted

pset2 Vigenere null pointer passed as argument 1, which is declared to never be null

Welcome to the community. Your program is a real mess of functions for a relatively simple task, the purpose of the use of functions is to perform specific tasks outside of main (), in order to keep ...
MARS's user avatar
  • 5,179
1 vote
Accepted

CS50 Pset4 Recover card.raw only NULL

You read the first 512 bytes (I used an array of uint8_t instead of int, but that should be possible as well), and print the first integer, representing the first 4 bytes. If you throw card.raw int ...
Blauelf's user avatar
  • 21k
1 vote
Accepted

What does time(NULL) mean when used with srand48?

According to this answer on Stackoverflow, the function time is normally passed a pointer to a time_t object (or struct) which it fills up with the current time. If you pass it null, however, you will ...
Martin Kleiven's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible