0

I am just wondering why the check result is like this:

:) hello.c exists :( hello.c compiles code failed to compile :| responds to name Emma can't check until a frown turns upside down :| responds to name Rodrigo can't check until a frown turns upside down To see the results in your browser go to https://submit.cs50.io/check50/b9ab0995e0860b28816dfa80d22b2cb4a0b7b0b3

I did all the steps but it still gives this, this is my code, please check

#include <stdio.h>
int main(void)
{
    printf("hello, world!\n");
  
}

#include <stdio.h>
#include <cs50.h> // Adicionar a biblioteca do CS50

int main(void)
{
    // get_string é uma função específica da biblioteca do CS50!
    string nome = get_string("Qual é seu nome? \n");
    printf("hello,%s \n", nome);
}
1
  • I just had the same problem, here is the solution; everything must be in one int main(void) and in one {}, also do not forget to include <cs50.h> as well as <stdio.h> in line 1-2.
    – Mersinder
    Commented Mar 19, 2023 at 20:47

1 Answer 1

0

You will get the same result when you compile the code in the IDE. check50 should be the final step before submitting your work. You need compile and run the program in your workspace before check50 to see whether it "works". The code posted here looks like two programs in one source file, each program starting at the line #include <stdio.h>.

Delete the lines of the first program from the source file. Compile the program (make hello in the terminal) and run it to ensure it works the way you expect it to.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .