This is the basic function of both C89 and C ++ 98, called "adjacent string concatenation" or near it.
Basically, if two string literals are adjacent to each other without punctuation between them, they are combined into one string, as your output shows.
In the C ++ 98 standard, section § 2.1 "Translation phases [lex.phases]":
6 Adjacent regular string literals are related to each other. Adjacent widescreen literal tokens are concatenated.
This is after the preprocessor completes.
In the C99 standard, the relevant section is §5.1.2.1 “Translation phases”, and it says:
6 Conjugate string literals are combined.
The wording will be very similar to any other C or C ++ standard you can rely on (and I really admit that C ++ 98 and C99 are replaced by C ++ 11 and C11, I just don't have electronic copies of the final standards, however )
Jonathan leffler
source share