Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • 3
    The OP should just remove the + as two consecutive string literals are automatically concatenated. Commented Feb 6, 2015 at 1:17
  • @user2676680 There are many non-member overloads for operator+ which take a const char* and a std::string. However, there is no built-in operator+ which takes two const char*s. Commented Feb 6, 2015 at 1:20
  • @user2676680 The last 2 sentences explain why the first one works Commented Feb 6, 2015 at 1:20
  • In case this did not become clear from @remyabel's comment: They are concatenated during translation of the program so it also has zero run-time overhead. If you don't have literals, you can replace your + with << but it will be less efficient in your current case. Commented Feb 6, 2015 at 1:21