Jump to content
  • Advertisement
Sign in to follow this  
phil05

Converting Char Arrays to Strings

This topic is 5068 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

There's times when strings are extremely nice to use for doing certain tasks. The only problem I noticed with windows is it bitches when you use them. So I have the character array, can I convert it to a second variable as a string?

Share this post


Link to post
Share on other sites
Advertisement
std::string sBuffer(cBuffer);
or
std::string sBuffer(cBuffer, cBuffer+100);
or
std::string sBuffer(cBuffer, 100);

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!