Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CString and string

Status
Not open for further replies.

kook04

Programmer
Jun 26, 2001
58
US
How do you convert a basic string to a CString? I have a function that only accepts a CString as input, and the data I have to pass to it is in the form of a string. Any help would be appreciated.
------
KJR
 
Look at CString.Format(..)

I think you need to use

CString s = CString.Format("%s", charname);
 
Is your input a C-style string? If so, just use it directly. If it's a true string, then use the c_str() member function.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top