Question: The following code compiles without problems:

```
int main() {
    printf("Hi" "Bye");
}

```

However, this does not compile:

```
int main() {
    int test = 0;
    printf("Hi" (test ? "Bye" : "Goodbye"));
}

```

What is the reason for that?

Answer: 
If you really want to have both branches produce compile-time string constants to be chosen at runtime, you'll need a macro.

```
#include <stdio.h>
#define ccat(s, t, a, b) ((t)?(s a):(s b))

int
main ( int argc, char **argv){
  printf("%s\n", ccat("hello ", argc > 2 , "y'all", "you"));
  return 0;
}

```
To answer the question - I would go to the definition of printf. The function printf expects **const char\*** as argument. Any string literal such as "Hi" is a const char\*; however an expression such as `(test)? "str1" : "str2"` is NOT a const char\* because the result of such expression is found only at run-time and hence is indeterminate at compile time, a fact which duly causes the compiler to complain. On the other hand - this works perfectly well `printf("hi %s", test? "yes":"no")`