How do you say something like this?
static const string message = "This is a message.\n
It continues in the next line"
The problem is, the next line isn't being recognized as part of the string..
How to fix that? Or is the only solution to create an array of strings and then initialize the array to hold each line?
Enclose each line in its own set of quotes:
static const string message = "This is a message.\n"
"It continues in the next line";
The compiler will combine them into a single string.
You can use a trailing slash or quote each line, thus
"This is a message.\n \
It continues in the next line"
or
"This is a message."
"It continues in the next line"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With