[gameprogrammer] Re: Is this valid?

According to this page no:

http://www.cplusplus.com/reference/string/string/c_str.html

which makes sense in a way...c_str() is just a function to give you a
null terminated string, but the string is stored differently internaly
so it's just giving you a read only copy to mess with.

On Jan 24, 2008 10:08 PM, Kevin Jenkins <gameprogrammer@xxxxxxxxxx> wrote:
> std::string s;
> s.reserve(strlen("Hello world"));
> strcpy(s.c_str(), "Hello world");
>
> ---------------------
> To unsubscribe go to http://gameprogrammer.com/mailinglist.html
>
>
>

---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html


Other related posts: