4
Why the following C code works?
char *str = "A""B"; /* str = "AB" */
However I noticed that it is only in string statements, for example the following would not work:
char *a = "A";
char *ab = a "B"; /* Funcionaria se a fosse uma macro */
I suspect it works because the compiler considers
"A""B"
as a single memory block and make the "concatenation" automatically.
In short I would like to know if my assumption is right or is for another reason.
so somehow my guess was right?
– SeventhBit
@Jonathagabriel Yes. The compiler makes a VIP treatment for string literals by considering them as a single string.
– Victor Stafusa