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: 
Because C has no `string` type. String literals are compiled to `char` arrays, referenced by a `char*` pointer.

C allows adjacent *literals* to be combined *at compile-time*, as in your first example. The C compiler itself has some knowledge about strings. But this information is *not present at runtime,* and thus concatenation cannot happen.

During the compilation process, your first example is "translated" to:

```
int main() {
    static const char char_ptr_1[] = {'H', 'i', 'B', 'y', 'e', '\0'};
    printf(char_ptr_1);
}

```

Note how the two strings are combined to a single static array by the compiler, before the program ever executes.

However, your second example is "translated" to something like this:

```
int main() {
    static const char char_ptr_1[] = {'H', 'i', '\0'};
    static const char char_ptr_2[] = {'B', 'y', 'e', '\0'};
    static const char char_ptr_3[] = {'G', 'o', 'o', 'd', 'b', 'y', 'e', '\0'};
    int test = 0;
    printf(char_ptr_1 (test ? char_ptr_2 : char_ptr_3));
}

```

It should be clear why this does not compile. The ternary operator `?` is evaluated at runtime, not compile-time, when the "strings" no longer exist as such, but only as simple `char` arrays, referenced by `char*` pointers. Unlike adjacent *string literals*, adjacent *char pointers* are simply a syntax error.
This does not compile because the parameter list for the printf function is

```
(const char *format, ...)

```

and

```
("Hi" (test ? "Bye" : "Goodbye"))

```

does not fit the parameter list.

gcc tries to make sense of it by imagining that

```
(test ? "Bye" : "Goodbye")

```

is a parameter list, and complains that "Hi" is not a function.