string processing and mutual conversions under different coding formats:
The data types that people often encounter when programming:
Ansi:
Char, char *, const char *
CHAR, (PCHAR, PSTR, LPSTR), LPCSTR
Unicode:
wchar_t, wchar_t *, const wchar_t *
WCHAR, (Pwchar, Pwstr, LPWSTR), LPCWSTR
T generic type:
TCHAR, (TCHAR *, Ptchar, PTSTR, LPTSTR), LPCTSTR
Above, where: P represents the meaning of the pointer, str stands for the meaning of the string, L is the meaning of the long pointer, can be ignored under the WIN32 platform, C stands for the meaning of the const constant, W stands for the meaning of the wide wide byte, t everyone can understand the meaning of the universal type,
It is possible to define _UNICODE macros according to the project, respectively, to define different types, such as: TCHAR type, if _UNICODE macro is defined in the project, then he is ultimately defined as the wchar_t type,
If the _UNICODE macro is not defined in the project, then TCHAR is ultimately defined as a char type.
Its convenience is to modify the coding format of the project without modifying the code, so it is recommended that you use the common type when writing programs!
VC Data types