在cppunit/Portability.h里面有这么一个:
/* Define to 1 if the preprocessor expands (#foo) to "foo" (quotes incl.)
I don't think there is any C preprocess that does NOT support this! */
#if !defined(CPPUNIT_HAVE_CPP_SOURCE_ANNOTATION)
# define CPPUNIT_HAVE_CPP_SOURCE_ANNOTATION 1
#endif
不过,我用VC6试了一下:
#include <iostream>
using namespace std;
int main(int argc, char* argv[])
{
cout << (#hello) << endl;
return 0;
}
不行。
error C2014: preprocessor command must start as first nonwhite space
原因是什么?
我去msdn上查找
找到了答案