Answers for "c++ string on multiple lines"

C++
1

c++ string on multiple lines

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."
Posted by: Guest on August-02-2021
1

how to cin multiple lines of strings c++

How to cin c++
Posted by: Guest on November-21-2019

Code answers related to "c++ string on multiple lines"

Browse Popular Code Answers by Language