So... whats the problem?Code:#include <stdio.h>
int main()
{
int x;
x = 0;
x = (x ? 1 : 0) /* Error here */
printf("%d\n", x);
return 0;
}
Printable View
So... whats the problem?Code:#include <stdio.h>
int main()
{
int x;
x = 0;
x = (x ? 1 : 0) /* Error here */
printf("%d\n", x);
return 0;
}
Missing semicolon on the x = (x?1:0) line...
--
Mats
Ah I'm a n00b! Maybe someone can delete this thread so I don't look too dumb.
Don't feel too bad. I've done the same more than once, and often the error message isn't very clear when you do this (because the compiler happily continues on the next line thinking it's fine, but of course gets very confused and eventually errors out - not quite as bad as missing braces tho').
--
Mats