Friday, July 31, 2009

Miracle C error messages?

How can I fix this error in Mirace C Compiler?





line 13: Parse Error, expecting `')'' or `',''


'if (cResponse is == 'a' || 'A') printf ("\nYou are Correct\n")'


aborting compile

Miracle C error messages?
It should be:





if (cResponse == 'a' || cResponse == 'A' )


printf("\nYou are Correct\n");
Reply:There's 3 things wrong with that.


if (cResponse == 'a' || cResponse == 'A') printf ("\nYou are Correct\n");





1. Why'd you put the "is"?


2. You can't do x == a || b, you have to do x == a || x == b


3. You need a semicolon to end the statement.
Reply:"cResponse is" spaces are not allowed, remove that "is".


No comments:

Post a Comment