Possible Duplicate:
concatenation of two string literals
Case 1 "hello" "world" (NO ERROR)
Case 2 "hello"+"world" (ERROR)
I know that the + operator must atleat have one of its operand as string type,not string literal.
Thing is,both of the cases doesnt make sense,since we can include it into a single literal !
Why is Case 1 allowed then!
Case 1 is allowed because C++ basically considers adjacent literals to be the same literal, i.e. the code
"hello" "world"is transformed into"helloworld"early on in the parsing.