just stumbled onto a miss in my code, a function was called like this
func("text1" "text2");
instead of
func("text1", "text2");
The thing is that it actually compiles and runs (MSVC 2008), the two strings are treated as one (ie a call to an overloaded func gets the input "text1text2").
Is this normal standard behaviour (ie. "abc" "def" == "abcdef") or isn't it ?
Yes, this is called string literal concatenation, and is a feature of the C and C++ compiler.
Yes, it's normal behavior. It's useful for having string constants span multiple lines. You must have an overload of "func" somewhere that can accept a single parameter of char*.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With