Sign in to follow this  
phil05

Converting Char Arrays to Strings

Recommended Posts

phil05    100
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
Fruny    1658
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this