Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - Convert C++ string to LPCTSTR
Convert C++ string to LPCTSTR
C++ string into LPCTSTR can refer to the following code:

string str = " hello

CString CSTR(str . c _ str());

MoveFile(cstr,.....); //CString is automatically converted to LPCTSTR.

Extended data:

String classes in C++

The CString class in MFC is very convenient to use, but if you leave the MFC framework, are there any classes that are convenient to use? The answer is yes. Some people may say that even without MFC framework, you can find a way to use API in MFC. The specific operation method is given at the end of this paper.

In fact, many people may ignore the use of string class in standard C++. The function of string class provided in standard C++ is also very powerful, which can generally meet the needs of our development projects.

Baidu Encyclopedia-String