Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Neosmyle

std::string to char*?

This topic is 5886 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Bah, I''ll just say it: how do you convert an std::string to a char*? I''ve tried some stuff which hasn''t worked, and I haven''t been using STL very long, and can''t seem to get past this. The thing that troubles me is that std::strings aren''t null-terminated?

Share this post


Link to post
Share on other sites
Advertisement
Sneftel: Thanks much.

I knew there would be a simple solution that I wasn''t familiar with. I would have found it eventually, except that the declaration for std::string is exceptionally long, even for an stl template, and I was getting brainfried trying to understand all of the functions from their names & return values. Should have gone to STL website; much better documentation than MSDN.

500 error

Share this post


Link to post
Share on other sites
yupyup... www.sgi.com/tech/stl is a URL every C++ programmer should know by heart.



Don''t listen to me. I''ve had too much coffee.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!