Skip to main content
1 vote
Accepted

Pset2 Functions video - Valid triangle solution

What I think you are doing wrong is, you are checking if an array is less than or equal to 0. What you should be doing is indexing into the array. Then it would be checking the float values. while (...
Kavija Karunarathna's user avatar
1 vote
Accepted

Cannot Compile Due to Error in cs50.h

The function signature has changed. From the CS50 Programmer's Manual char *get_string (const char *format, ...); DESCRIPTION Prompts user for a line of text from standard input and ...
DinoCoderSaurus's user avatar
1 vote
Accepted

Switch(c) undeclared identifier

Simply put, c doesn't exist because it was never declared, and no value has been assigned to it. I could explain in detail, but the following site has already done it very nicely, including an ...
Cliff B's user avatar
  • 69.1k
1 vote

I don't understand how the collatz(n) recursive function works

Based on the Collatz Conjecture, all values of n will eventually reach the value of 1 and fall into the pattern of 1, 4, 2, 1, 4... continuing forever. Therefore we want to have a base condition to ...
AndJF's user avatar
  • 11
1 vote
Accepted

C data types and format specifiers

INT02-C. Understand integer conversion rules Conversions can occur explicitly as the result of a cast or implicitly as required by an operation. Although conversions are generally required ...
Yuri Laguardia's user avatar
1 vote

C data types and format specifiers

Looks like C is (internally) casting the constant 2 (or probably more correctly, the result of n - 2) as an int since that is the essential difference between the two printfs. You might search the ...
DinoCoderSaurus's user avatar

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