c++200例子之100---#ifndef应用

#include<iostream.h>
#define   PI   3.1416
void main()  {
    int i=100;
#if 1
    cout<<"i="<<i<<endl;
#endif

#ifdef PI
    cout<<"1  PI="<<PI<<endl;
#endif

#ifndef PI
    cout<<"2  PI="<<PI<<endl;   //此语句不被编译执行
#endif
}

posted @ 2008-11-20 17:34  雨城  阅读(313)  评论(0编辑  收藏  举报