http://GameProgrammer.Com

Programming

GP Mailing List
     Thread Index
     Date Index

ATXGPSIG List
     Thread Index
     Date Index

Google
>

Home

Wise2Food



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[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@rakkar.org> 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