(C++) Initialize string with HUGE amount of text, not from txt -


i have quick question think has quick answer. have string variable , need filled predetermined characters. problem is, have lot put in it. how can fill string text without having huge ("lotsandlotsoftext"); when declare it? don't want in separate text file.

thanks :)

use string resource load std::string.

1) add string resource editor: how add string resource in visual studio 2008

2) use loadstring

3) use loadedstring parameter constructor

    tchar buf[<yourverylongstringlength>];      loadstring(hinst, ids_yourstringresource, buf, sizeof(buf)/sizeof(tchar));      const std::string yourcplusplusstring = buf; 

msdn loadstring

example of using loadstring


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -