Daniel Heiserer wrote:[color=blue]
>
> Hi,
> I want to fill a string like this:
>
> using namespace std;
> string text="
> now a lot of text ................
> now a lot of text ................
> now a lot of text ................
> now a lot of text ................
> now a lot of text ................
> ";
>
> I get the warning message using g++ (GCC) 3.2.2 on linux:
> ......warning: multi-line string literals are deprecated
>
> Is there a way to write large portions of text right into the
> code without getting these warnings?
> I do not want to write something like this:
>
> string text;
> text+="now a lot of text ................";
> text+="now a lot of text ................";
> text+="now a lot of text ................";
> text+="now a lot of text ................";
> text+="now a lot of text ................";
>[/color]
"now " "a " "lot " "of " "text"
is equivalent to "now a lot of text".
In other words: The compiler will catanate individual string
literals into one literal on its own.
Therefore:
string text= "now a lot of text ................"
"now a lot of text ................"
"now a lot of text ................"
"now a lot of text ................"
"now a lot of text ................"
;
does exactly what you want.
--
Karl Heinz Buchegger
kbuchegg@gascad.at