Quote:
Originally Posted by GODPARTICLE
[You must be logged in to view images. Log in or Register.]
btw what is that Rogean perl or something? What's the world coming to with ternary operations in a string format. Wonder if that's valid in C/C++
|
I thought it would be, my assumption is correct
Code:
#include <stdio.h>
int main()
{
const int b = 1;
printf("%s %s", b ? "cando" : "nutdo", !b ? "cando" : "nutdo");
return 0;
}
output
compiles with both c and c++