1

I get many compilation errors when I compile greedy.c.

However, my mario.c and greedy.c programs with 2 and 3 residual appear to pass check50 tests!

jharvard@appliance (~/Dropbox/pset1): check50 2014/x/pset1/greedy greedy.c
:) greedy.c exists
:( greedy.c compiles
   \ expected an exit code of 0, not standard error of "greedy.c:7:4: error: expected identifie..."
:| input of 0.41 yields output of 4
   \ can't check until a frown turns upside down
:| input of 0.01 yields output of 1
   \ can't check until a frown turns upside down
:| input of 0.15 yields output of 2
   \ can't check until a frown turns upside down
:| input of 1.6 yields output of 7
   \ can't check until a frown turns upside down
:| input of 23 yields output of 92
   \ can't check until a frown turns upside down
:| input of 4.2 yields output of 18
   \ can't check until a frown turns upside down
:| rejects a negative input like -.1
   \ can't check until a frown turns upside down
:| rejects a non-numeric input of "foo"
   \ can't check until a frown turns upside down
:| rejects a non-numeric input of ""
   \ can't check until a frown turns upside down

I was wondering, if there are compilation errors, check50 will not even permit running that program with residual compilation errors. Am I right or wrong?

5
2
:( greedy.c compiles
\ expected an exit code of 0, not standard error of "greedy.c:7:4: error: expected identifie..."

That frown :( and the fact that it is displayed in red means that your code didn't pass the compile "test". You then have all those yellow messages with a :| which means those tests never ran.

Check50 shows you all the tests and color codes it to let you know what passed and what didn't. Just because you see greedy.c compiles, it doesn't mean that it actually did compile unless it is in green with a :) in front of it.

2
  • Thanks for the clarification of check50 results. Still I donot understand why I get a compiling error when I do not put a semicolon aster int main(void)? post author @curioski
    – uma1966
    Jul 8 '14 at 6:21
  • Because you don't have a { after it. Remember that the main function must be contained with { } int main(void) { //program here } You were missing the { so it wouldn't compile. When you instead added a ; int main(void); that told the compiler that you were making a complete statement so it wasn't an error. But the rest of the program wouldn't compile at that point either.
    – curiouskiwi
    Jul 8 '14 at 6:24

You must log in to answer this question.

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