Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

c++ cstring to string

//Long way:
CString cs ("Hello");
// Convert a TCHAR string to a LPCSTR
CT2CA pszConvertedAnsiString (cs);
// construct a std::string using the LPCSTR input
std::string strStd (pszConvertedAnsiString);


//Short way:
auto myString = (string)CT2CA(cs);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #cstring #string
ADD COMMENT
Topic
Name
6+6 =