How does C++ recognize multi-line strings?

93 Views Asked by At

As we know, C++ has the following two ways of representing multi-line strings(In fact, there are other ways, but I only focus on these 2.):

std::string multiline_str1 =
        "Hello hello "
        "world "
        "by cpp.";

std::string multiline_str2 = "Hello hello \
world \
by cpp.";

I'm curious how c++ recognizes them as a string. Is it solved in the lexical analysis stage? Or is it solved in the syntax analysis stage?

If you can give me some blogs, or tell me what source code I should look at, I would be very grateful.

0

There are 0 best solutions below