Implementation of string literal concatenation in C and C++

后端 未结 5 1913
北海茫月
北海茫月 2021-01-12 03:05

AFAIK, this question applies equally to C and C++

Step 6 of the \"translation phases\" specified in the C standard (5.1.1.

5条回答
  •  北海茫月
    2021-01-12 03:35

    Unless the preprocessor is specified to handle this, it's safe to assume it's the compiler's job.

    Edit:

    Your "I.e." link at the beginning of the post answers the question:

    Adjacent string literals are concatenated at compile time; this allows long strings to be split over multiple lines, and also allows string literals resulting from C preprocessor defines and macros to be appended to strings at compile time...

提交回复
热议问题