为什么新建一个字符串也这么多错误?
一个WIN32工程(不用MFC)
int nBufSize = 32;
LPSTR pszNewBuf = new char[nBufSize];
编译提示错误:
E:\Pop3.cpp(842) : error C2065: 'DEBUG_NEW' : undeclared identifier
E:\Pop3.cpp(842) : error C2440: 'initializing' : cannot convert from 'int' to 'char *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
E:\Pop3.cpp(842) : error C2144: syntax error : missing ';' before type 'char'
E:\Pop3\Win32_lin_V2\Pop3.cpp(842) : warning C4091: '' : ignored on left of 'char' when no variable is declared
E:\Pop3.cpp(842) : error C2143: syntax error : missing ';' before '['
E:\Pop3.cpp(842) : error C2143: syntax error : missing ';' before '['
我的DEBUG_NEW在头文件是这么定义的:
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
晕。