在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上查找
找到了答案
http://msdn2.microsoft.com/en-us/library/7e3a913x.aspx
发表于 @ 2006年04月25日 15:29:00 | 评论( loading... ) | 举报| 收藏