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 ...
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.
...
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 ...
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 ...
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
null × 18pset2 × 5
recover × 4
pset4 × 3
pset5 × 3
cs50x × 3
c × 3
pointers × 3
string × 2
malloc × 2
pset3 × 1
speller × 1
vigenere × 1
caesar × 1
segmentation-fault × 1
pset4recover × 1
array × 1
crack × 1
structs × 1
command-line-arguments × 1
file-pointer × 1
getstring × 1
initialize × 1