Search
 
SCRIPT & CODE EXAMPLE
 

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);
Comment

PREVIOUS NEXT
Code Example
Cpp :: remove from vector by value c++ 
Cpp :: stringstream stream number to string 
Cpp :: back() in c++ 
Cpp :: C++ Volume of a Cylinder 
Cpp :: rotate array cpp 
Cpp :: string to integer in c++ 
Cpp :: find duplicate from an array c++ 
Cpp :: c++ int to char* 
Cpp :: draw rectangle opencv c++ 
Cpp :: reverse order binary tree in c++ 
Cpp :: ascii conversion cpp 
Cpp :: c++ basic snippet 
Cpp :: c++ get line 
Cpp :: classes and objects in c++ 
Cpp :: sleep in c++ 
Cpp :: a square plus b square plus c square 
Cpp :: c define 
Cpp :: Converting to string c++ 
Cpp :: how to slice vector in c++ 
Cpp :: use of alphanumeric function c++, check if alphabet or digit from string 
Cpp :: insert in vector 
Cpp :: SUMOFPROD2 
Cpp :: getline() 
Cpp :: visual studio getline not working 
Cpp :: is anagram c++ 
Cpp :: c++ inheritance constructor 
Cpp :: sfml keyboard events cpp 
Cpp :: reference c++ 
Cpp :: c++ delay 
Cpp :: put function in cpp 
ADD CONTENT
Topic
Content
Source link
Name
5+1 =