2
votes
Accepted
Pset1 Cash - Trying to round float value DURING computation and not after
The code seems far more complicated than necessary, but this seems to be because you're trying to handle the imprecise float storage problem unsuccessfully.
This can be resolved by simply converting ...
1
vote
Accepted
PSET 4 - Filter Grayscale
The reason is that if the code is doing division with all integers, it will do integer division, not normal division.
Integer division will truncate the fractional part of the division. So, if the ...
1
vote
Accepted
pset1 - CS50 directory not found for ./integer. Keep getting bash error - help?
Simply put, the file integer, the executable file, doesn't exist. Only the source code file integer.c exists. You need to make integer first, in order to compile the source code and produce the ...
1
vote
Accepted
Vigenere error compiling: type int vs unsigned long
I assume the % strlen(key) is causing some type conversion.
Your logic is wrong. First iterate the key to ensure all characters are alphabetic, and maybe also uppercase the key there if you want. ...
1
vote
Accepted
find.c in Pset 3; int straw = get_int(); ./generate 1000 50 | ./find 127; From where and how it takes 1000?
get_int() has no knowledge of the "2nd argument from generate.c". Remember from the spec:
You’ll be prompted to provide some hay (i.e., some integers), one "straw" at a time. As soon as you tire of ...
Only top scored, non community-wiki answers of a minimum length are eligible