m_duran
  • Member for 7 years, 6 months
  • Last seen more than 3 years ago
pset 3 "control may reach the end of a non-void function"
3 votes

Your function is declared as having a return type, but the structure of your function is not guaranteed to return anything. For example, if you have: bool myfunction(int x) { if(x > 10) {...

View answer
do while loop not working?
3 votes

Your condition is flawed. If x is greater than 0 OR x is less than 23, the loop will keep going. x > 0 includes all positive numbers, and x < 23 includes all negative numbers in addition to ...

View answer
How to Encrypt Plaintext Properly When it Contains Non-Alphabetical Chars?
3 votes

As others have said, you can reduce your loops by combining what they do into one loop. You don't need to store the user input, so you can modify it without worry. Other than that, I would just add ...

View answer
My sort and search functions don't work for find.c - look at my code?
3 votes

Think about what is happening in your sorting algorithm. When you are doing a swap algorithm, you need a third variable to store the value of one variable temporarily. For example, if we have a = 5 ...

View answer
Greedy - what's did I do wrong with round()?
2 votes

%a in printf() is used to print a float as a hexidecimal. That is why you are getting the 0x1.49e000... number in the output. Use %i or %d for an integer. And as was pointed out, you don't need to ...

View answer
CS50 Pass Word-Need it changeif I change my yaoo account Pass Word
1 votes

Your Yahoo account and edx account are completely separate. Changing one does not change the other.

View answer
How to Check Whether a String Contains Non-Alphabetical Characters?
0 votes

If I understand what you're trying to do correctly, you want to check inside the else if() if the string has only alpha characters, but you can't exactly put a loop inside there. What you can do, ...

View answer
"Killed by server" at the check50 test: rejects negative input like -.1
0 votes

You have to write code that doesn't accept a negative number, as negative change doesn't make sense. As long as the input is not in the correct range, keep asking for input, just like in mario.c I ...

View answer
Errors Running mario
0 votes

There are many syntax errors. It's not uncommon when you're first learning any language, including C. I strongly suggest you re-watch the lecture and some of the shorts videos. As others have said, ...

View answer
Compiler errors while using Clang
Accepted answer
-1 votes

There's no shortcut around it, you need to compile and run your program before you can check if it runs correctly, and to do that you need to fix your syntax errors. Don't worry about check50 until ...

View answer