-
LPCSTR
鎖定
LPCSTR英文解釋
A 32-bit pointer to a character string that is portable for Unicode and DBCS.
LPCSTR中文解釋
L表示long指針
P表示這是一個指針
C表示是常量const
STR表示這個變量是一個字符串
LPCSTR轉換
轉換成CString
LPCSTR lpStr = "test";
CString str(lpStr);
CString反轉換
CString str(_T("test"));
LPCSTR lpStr = (LPCSTR)str;
LPCSTRC語言中使用
是以零結尾的字符串指針,相當於CHAR *。例子:
vuser_init() { /* LPCSTR is a char * . */ LPCSTR server; LPCSTR user = "tomh"; LPCSTR password = "pwd"; LPCSTR connect[10]; server=lr_get_attrib_string("host"); if (server==NULL){ lr_error_message("Failed to login. Unknown host.\n"); return(0); }