📜  c++ 多行字符串 - C++ 代码示例

📅  最后修改于: 2022-03-11 14:44:45.215000             🧑  作者: Mango

代码示例1
std::string firstWay =
  "This text is pretty long, but will be "
  "concatenated into just a single string. "
  "The disadvantage is that you have to quote "
  "each part, and newlines must be literal as "
  "usual.";

//or you can place a \ char just before the end of the line
std::string secondWay =
  "Here, on the other hand, I've gone crazy \
and really let the literal span several lines, \
without bothering with quoting each line's \
content. This works, but you can't indent."