用户操作
[留言]  [发消息]  [加为好友] 
订阅我的博客
XML聚合    FeedSky
订阅到鲜果
订阅到Google
订阅到抓虾
maxcai的公告
本站的内容,不保证技术的正确性<br> 实际上:定性多于定量
文章分类
    存档

    原创  不解之(#foo)与preprocessor 收藏

    在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... ) | 编辑| 举报| 收藏

    旧一篇:CppUnit学步 | 新一篇:哈哈,MS也会写错别字哦~~

    • 发表评论
    • 评论内容:
    •  
    Copyright © maxcai
    Powered by CSDN Blog