how to define a const multileline string
-
how to define a const multileline string as const string TEMPLATE = "HELLO! IF YOU CAN HELP ME , I WILL THANK YOU VERY MUCH"; this can not pass complie I love Programming
-
sorry , i don't want the "\n", because it not readable if there is a solution that present multile line is very good! I love Programming
I'm afraid you are not in a position to write the language yourself, you have to live with the language as it exists. Best you can do is this: #define NEWLINE \r\n and then use NEWLINE, or something similar. In any case, \n won't work, it's \r\n ( or \n\r, I forget ). Christian Graus - Microsoft MVP - C++
-
how to define a const multileline string as const string TEMPLATE = "HELLO! IF YOU CAN HELP ME , I WILL THANK YOU VERY MUCH"; this can not pass complie I love Programming
-
how to define a const multileline string as const string TEMPLATE = "HELLO! IF YOU CAN HELP ME , I WILL THANK YOU VERY MUCH"; this can not pass complie I love Programming
Do you want it to be multiline only in your source code
const string TEMPLATE = "These three string literals will be "
"concatenated and the result assigned "
"to TEMPLATE as a single string";or do you want it to contain multiple lines
const string TEMPLATE = "These are the first,\r\nsecond,\r\nand third lines";
or both?
const string TEMPLATE = "These are the first,\r\n"
"second,\r\n"
"and third lines";-- jlr http://jlamas.blogspot.com/[^]
-
Do you want it to be multiline only in your source code
const string TEMPLATE = "These three string literals will be "
"concatenated and the result assigned "
"to TEMPLATE as a single string";or do you want it to contain multiple lines
const string TEMPLATE = "These are the first,\r\nsecond,\r\nand third lines";
or both?
const string TEMPLATE = "These are the first,\r\n"
"second,\r\n"
"and third lines";-- jlr http://jlamas.blogspot.com/[^]
-
I'm afraid you are not in a position to write the language yourself, you have to live with the language as it exists. Best you can do is this: #define NEWLINE \r\n and then use NEWLINE, or something similar. In any case, \n won't work, it's \r\n ( or \n\r, I forget ). Christian Graus - Microsoft MVP - C++
\r\n for Windows, \n for Unix and \r for Mac. I love standards :sigh: The tigress is here :-D