I think I may be confussing the difference between strings and string literals.
I know this works:
but if I try this:Code:const string hello = "Hello"; const string greeting = hello + ", world" + "!";
I get a compiler error. I'm not sure I follow why this doesn't work. I've tried a bunch of combinations, but it won't let me do the above.Code:const string explan = "!"; const string greeting = "Hello" + ", world" + explan;
Why is this illegal?