_ifdef_else__endif和_ifndef的用法.docVIP

  • 4
  • 0
  • 约2.3万字
  • 约 19页
  • 2016-12-04 发布于河南
  • 举报
_ifdef_else__endif和_ifndef的用法

#ifdef,#else,#endif和#ifndef的用法(1) #ifdef,#else,#endif和#ifndef的用法(1) #ifdef的用法 灵活使用#ifdef指示符,我们可以区隔一些与特定头文件、程序库和其他文件版本有关的代码。 代码举例:新建define.cpp文件 #include,,,,,,,,iostream.h,,,,,,,,,,,,,,,,//stream流,流动 int,,,,,,,,main() { #ifdef,,,,,,,,DEBUG?????? cout,,,,,,,,Beginning,,,,,,,,execution,,,,,,,,of,,,,,,,,main(); #endif?????? return,,,,,,,,0; } 运行结果为:Press,,,,,,,,any,,,,,,,,key,,,,,,,,to,,,,,,,,continue,,,,,,,,//没有定义 改写代码如下: #include,,,,,,,,iostream.h #define,,,,,,,,DEBUG int,,,,,,,,main() { #ifdef,,,,,,,,DEBUG?????? cout,,,,,,,,Beginning,,,,,,,,execution,,,,,,,,of,,,,,,,,main(); #endif??????? ret

文档评论(0)

1亿VIP精品文档

相关文档