The sixth day of learning vc ++ - Microsoft's definition of a string

I put the video is paused to  https://www.bilibili.com/video/av79302998?p=62

Then look at the way on bytes processed, because I have found to extract a string out to each write #ifdef UNICODE very troublesome

Ever since I saw  https://www.bilibili.com/video/av38413272/?p=1  all bytes of process

● Narrow bytes:
 char, char *, const char * 
CHAR, (PCHAR, PSTR, LPSTR), LPCSTR
 
● the Unicode byte width: wchar_t, wchar_t
 *, const wchar_t * 
WCHAR, (PWCHAR, PWSTR, LPWSTR), LPCWSTR
 
● General type T: TCHAR, (TCHAR
 *, PTCHAR, PTSTR, LPTSTR), LPCTSTR
 
LPCTSTR type: 
L represents the long pointer which is compatible to the Windows . 3 .1 16 other legacy operating systems, as well as in other win32 32-bit operating system, and long far pointer and near pointer modifiers are compatible for effect. No practical significance. 
This is a pointer P represents 
C represents a constant 
and T represents the Win32 environment, there is a macro _T 
STR indicates that the variable is a string
Method Memory: L (length) P (pointer) C (constant) T (generic) the STR (String)

That we only need to use the generic type to handle strings like .. that is, in fact, Microsoft is the set of her layer by layer ...

So complex is a complex understanding of the definition of feeling after not complicated ...

After all, macros, and strings are discouraging entry CPP king ...

 

Then cpp string class byte wide but narrow top layer Wa, plus a little member functions,

CString string and the difference that comes with a small string member function, so CString has set a layer of baby ...

However, in order to improve the developer to use a string of many programs, such as QT there QString ....

Why cpp standard it does not provide that perfect string class ....

Messy .....

 

 

 

⎛⎝⊙⏝⏝⊙。⎠⎞⎛⎝⓿⏝⏝⓿。⎠⎞

Guess you like

Origin www.cnblogs.com/JJBox/p/12535978.html