Questions tagged [cs50x2020]
The cs50x2020 tag has no summary.
31 questions
0 votes
1 answer
981 views
API key or look up function error in cs50 finance pset9?
I was working on the implementation of buy and trying to buy stocks when all of a sudden I began receiveing incorrect/invalid stock symbol for every stock symbol I tried(as if the stock symbol was not ...
0 votes
1 answer
142 views
:( handles lack of key failed to execute program due to segmentation fault
The following piece of code I've written for pset2/caesar produces a "segmentation error" when there is a lack of key (when no command-line argument is provided). I don't know which line or ...
-1 votes
1 answer
77 views
pset3 - plurality - failing check50 'print multiple winners' - but my own tests say it works, not sure what I'm missing
I'm not sure why my program is failing check50, when I run my own tests it does seem to print multiple winners, but check50 says it doesn't print multiple winners [removed solution code]
0 votes
1 answer
65 views
Why is my recover code not giving any output?
I'm very confused why this code is not giving any output: Code: #include <stdio.h> #include <stdlib.h> #include <stdint.h> typedef uint8_t BYTE; long int findSize(char file_name[]) ...
0 votes
1 answer
243 views
Pset1 Cash less comfortable - not running for 0.41 and 0.01
-- hi im running into a problem with my code. It's executed pretty well with many inputs except for 0.41 and 0.01. It didn't print out any answer but just ran indefinitely... #include <stdio.h> #...
0 votes
0 answers
82 views
PSET5 dictionaries won't load
I cannot get my dictionaries to load and cannot figure out why. Here is my load function: // Loads dictionary into memory, returning true if successful else false bool load(const char *dictionary) { ...
0 votes
1 answer
2k views
incompatible pointer types passing 'string' (aka 'char *') to parameter of type 'string *' (aka 'char **')
Im writing a funtion that takes string as a argument and gives back a integer. This function counts lenght of a string entered at the command line argument. I get an error :" incompatible pointer ...
1 vote
1 answer
47 views
Making code neater: a way to reduce repeated logical operators?
For CS50 pset1 Credit I'm using repeated logical-OR operators (||) to work out the validity and card brand of a credit card number. When I evaluate the style of my code using style50 it says to insert ...
0 votes
1 answer
1k views
How do you find the first digit of a long number?
I wrote the following code to try to find the first digit of a long number (this is for the CS50x "Credit" exercise), but it's not working. Any tips? // Conditions and relational operators #...
0 votes
3 answers
509 views
PSET 5 Hash help
I started my load function without looking at any reference code (first time starting a pset this way) to give me an idea on how to implement my own version. I was mostly confident until I reached the ...
1 vote
1 answer
72 views
CS50 recover (fclose giving segmentation fault)
found a few answers to the segmentation fault issue in CS50 recover while closing the file but I couldn't translate the answers to my issue: The last part: fclose(f); fclose(img); is resulting into ...
2 votes
2 answers
429 views
PSET 4 Reflect help
I am not sure why I am having issues with my code. I know I can store the rgb values for the left pixels in 3 temporary variables then assign the right values to the left and the temp values to the ...
0 votes
1 answer
246 views
PSet 6: DNA gives correct as well as wrong ouput
Problem Set 6: DNA gives output No Match No Match No Match No Match No Match No Match No Match No Match No Match No Match Lavender No Match No Match No Match No Match No Match No Match No Match No ...
0 votes
1 answer
318 views
PSet5 case-insensitive using strcasecmp
Tried iteration over strlen and random constant variable but unable to solve: :( spell-checking is case-insensitive expected "MISSPELLED WOR...", not "MISSPELLED WOR..." Here is my full code: // ...
0 votes
2 answers
84 views
PSET4 recover. Why doesn't my counter increase?
Below is my working code but I've a question. If change my char filename[8] to char filename[7] the counter does not increase. Instead, I'll only have 2 output files: 000.jpg and 001.jpg, where 001....