- This topic is empty.
Viewing 1 post (of 1 total)
Viewing 1 post (of 1 total)
- You must be logged in to reply to this topic.
Software programming learning aide
CS50 threads to aide as a supplementary resource › Forums › CS50’s Introduction to Computer Science by Harvard University on Edx › Week 2 › Seeking an explanation how function argument works
Tagged: scrabble lab problem
int compute_score(string word);
string find_winner(int score1, int score2);
With compute_score, there will be two words used, word1 and word2. Instead of
int compute_score(string word1,string word2);
It is
int compute_score(string word);
This is unlike score1, score2 with find_winner. Is it due to get_string function to be used for getting input?
What is confusing is that while word argument with compute_score will subsequently change to word1 and word2, the arguments with find_winner (score1, and score2) are mentioned exactly the way they will be later used.
Reply
https://edstem.org/us/courses/176/discussion/1791039?answer=4108983[learn_press_profile]