string literals split across lines

Is this legal in standard C++?

cout << "hello"
"world" << endl;

I've always assumed a stream insertion operator was required between the string literals. But the code works as is in g++ and (reportedly) other compilers.

Where can I go to look this up myself next time so I don't have to bother you again? :)

Thanks!
It's a kind of string concatenation that happens at compile-time. If you have two string literals (and only for string literals) of the same type next to each other, the compiler merges them into one.
Topic archived. No new replies allowed.