New answers tagged cs50x
0
votes
Pset5 Speller - trying to understand more about segmentation fault
That's the thing about memory violations: unpredictable results. Any word longer than 26 characters will violate memory regardless of how buffer is defined. What does the spec say about length of ...
- 27.5k
0
votes
reverse .wav file not working correctly
Ok I found it, I just had to say:
while (ftell(input) >= sizeof(header)) instead of while (ftell(input) > sizeof(header))
0
votes
Problem set 4 recover producing only one image, that too is corrupted
I figured out the problem, it's the binary mode issue as mentioned here. Replacing the r by rb while opening the raw file solves the problem.
- 101
2
votes
Accepted
I need help to fix my selection sort code - Practice Problems (Average High Temperatures)
that's a lot of code for a selection sort. It should be able to be sorted without need for a second array and with only two nested for loops.
The setup is pretty straightforward. I'll give a verbal ...
- 66.7k
1
vote
Accepted
Nested for loop not returning to parent in substitution.c
wouldn't the inner loop work better if it incremented j instead of i? ;-)
Programming tip: Look at the for loop setup:
for(int j = i + 1; j < strlen(key); i++)
It's better to set a var equal ...
- 66.7k
0
votes
Week 1 Lab 1 Population size
there are two problems here. First of all, "./population" is the command to execute the compiled program, not to actually compile it. The correct command is "make population"
...
- 66.7k
Top 50 recent answers are included
Related Tags
cs50x × 995c × 149
pset4 × 127
pset1 × 91
pset3 × 86
pset2 × 82
recover × 76
speller × 69
pset5 × 62
cs50-ide × 59
finance × 56
vigenere × 38
resize × 37
check50 × 37
caesar × 34
mario × 31
pset7 × 30
pset6 × 29
python × 27
segmentation-fault × 26
load × 20
cash × 19
help × 19
pset4recover × 18
runoff × 18