I have the following code:
int i=1;
printf((i==1)?" ":" " "hello");
printf(" " "hello");
And I am astonished to see that the first printf only gives a space as output and the second printf outputs a space followed by the string hello. I was expecting output like second one in case of first one. But is there something here I am missing. Please help me with this …
String literal joining is a lexical feature, which means this:
is the same as this:
It should now be pretty obvious why you get the result you get.