LPTSTR与CString类型如何比较是否相等
LPTSTR指向的字符串和CString存储的字符串如何判断是否相等?
回复 楼主 李静

//typedef LPSTR PTSTR, LPTSTR; //LPTSTR -> LPSTR //typedef CHAR *LPSTR, *PSTR; //LPSTR,PSTR -> CHAR * LPTSTR lptStr = "Hello"; CString csStr = "Hello"; CString csStr1 = "HEllo"; if(csStr == lptStr) { AfxMessageBox("csStr == lptStr"); } if(csStr1 == lptStr) { AfxMessageBox("csStr1 == lptStr"); }