1。在WinAPI中的數(shù)據(jù)類型中,LPSTR、LPCSTR、LPWSTR、LPCWSTR的具體區(qū)別是什么?
LPCSTR A 32-bit pointer to a constant character string.
LPSTR A 32-bit pointer to a character string.
LPCWSTR Pointer to a constant null-terminated string of 16-bit Unicode characters. For more information, seeCharacter Sets Used By Fonts
LPWSTR Pointer to a null-terminated string of 16-bit Unicode characters. For more information, seeCharacter Sets Used By Fonts.
LPSTR A 32-bit pointer to a character string.
LPCSTR A 32-bit pointer to a constant character string.
LPSTR 一個32位的指向字符串的指針
LPCSTR 一個32位的指向字符串常量的指針
LPWSTR 一個32位的指向unicode字符串的指針
LPCWSTR 個32位的指向unicode字符串常量的指針
前面的L代表LONG,P就是指針的意思,C就是constant的意思
W是wide的意思,STR就是string的意思
具體的定義參看頭文件
typedef char *LPSTR;typedef const char *LPCSTR;typedef w_char *LPWSTR;typedef char w_char *LPCWSTR;