条件编译就是控制编译范围。代码分析如下:
工具/原料
1
C++
2
程序
方法/步骤
1
#include 'PRO.h'//程序根目录头文件#include
2
using namespace std;//标识符空间
3
#define RUN//定义RUN
4
int main()//主函数
5
int x=1,y=2,z=3;//定义变量#ifndef RUN//条件编译命令cout <<'x=' <
6
程序完整源码如下:
上一篇:c/c++自学整理
下一篇:c#调用C++ DLL文件