#if 0 ..... #endif块到底是做什么的? [英] What exactly does an #if 0 ..... #endif block do?

查看:177
本文介绍了#if 0 ..... #endif块到底是做什么的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

C / C ++

放置在 #if 0 / #endif 块?

#if 0

//Code goes here

#endif

推荐答案

不仅不执行它,甚至不执行它?

Not only does it not get executed, it doesn't even get compiled.

#if 是预处理程序命令,该命令在实际编译步骤之前进行评估。

#if is a preprocessor command, which gets evaluated before the actual compilation step. The code inside that block doesn't appear in the compiled binary.

它通常用于临时删除代码段,以便稍后重新打开。

It's often used for temporarily removing segments of code with the intention of turning them back on later.

这篇关于#if 0 ..... #endif块到底是做什么的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆