How to declare a variable that spans multiple lines

Posted by Chris Wilson on Stack Overflow See other posts from Stack Overflow or by Chris Wilson
Published on 2011-01-17T13:09:02Z Indexed on 2011/01/17 14:53 UTC
Read the original article Hit count: 204

Filed under:
|

I'm attempting to initialise a string variable in C++, and the value is so long that it's going to exceed the 80 character per line limit I'm working to, so I'd like to split it to the next line, but I'm not sure how to do that.

I know that when splitting the contents of a stream across multiple lines, the syntax goes like

cout << "This is a string"
           << "This is another string";

Is there an equivalent for variable assignment, or do I have to declare multiple variables and concatenate them?

Edit: I misspoke when I wrote the initial question. When I say 'next line', I'm just meaning the next line of the script. When it is printed upon execution, I would like it to be on the same line.

© Stack Overflow or respective owner

Related posts about c++

Related posts about variables