複製鏈接
請複製以下鏈接發送給好友

LPCSTR

鎖定
LPCSTR是Win32VC++所使用的一種字符串數據類型。LPCSTR被定義成是一個指向以'\0'結尾的常量字符的指針
中文名
LPCSTR
類    型
字符串數據類型
系    統
Win32和VC++
隸    屬
指針

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);
}