Sign in to follow this  
BettaThnU

Help with std::string

Recommended Posts

Hey guys I was wondering if any of you knew how to change a std::string to an LPCSTR. All of my string data is stored as a std::string but the function I need to use will only work with and LPCSTR. Any help would be greatly appreciated. BTW The function Iam trying to use is the ID3DXFont::DrawText.

Share this post


Link to post
Share on other sites
string str = "This is a string";
LPCSTR cstr = str.c_str();



Basically, the c_str() method of the string class return a const char *, and an LPCSTR is the same thing (long pointer to a constant string).

Regards,
jflanglois

[edit] Hmph, beaten

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