[gameprogrammer] Re: Is this valid?
- From: "Alan Wolfe" <alan.wolfe@xxxxxxxxx>
- To: gameprogrammer@xxxxxxxxxxxxx
- Date: Thu, 24 Jan 2008 22:12:02 -0800
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
- References:
- [gameprogrammer] Is this valid?
- From: Kevin Jenkins
Other related posts:
- [gameprogrammer] Is this valid?
- From: Kevin Jenkins