Skip to main content
3 votes

recursive atoi | CS50

In C all variables must be declared at the top of the body of a function they can't be declared later. int convert(string input) { int length = strlen(input); int temporaryInt = 0; // declare it ...
UpAndAdam's user avatar
  • 1,456
1 vote
Accepted

Inifinite loop for outdated problem

Adding another answer based on your new code. I'm giong to make some changes in that code and point out my changes with comments. NOTE THIS ANSWER ACTUALLY HAS AN ERROR IN IT WHICH I HAVE DELIBERATELY ...
UpAndAdam's user avatar
  • 1,456
1 vote

Inifinite loop for outdated problem

So many problems here. Strongly suggest you break the problem into subproblems. This is the way in programming. Writing one big huge long main function is a nono. It's hard to read, it's hard to ...
UpAndAdam's user avatar
  • 1,456
1 vote
Accepted

Plurality - Test does not pass for the case of Bob

Try an election with 6 voters: Alice 2 votes, Bob 3 votes, Charlie 1 vote. Does it print the winner? What is the value of highest in the second loop? How many votes does Bob have? If you are not ready ...
DinoCoderSaurus's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible