if 0 endif
时间: 2023-12-14 17:03:06 浏览: 75
#if 0和#endif是条件编译的语句,在编译代码时,#if 0之间的代码会被忽略掉,相当于注释掉。这样可以在不删除代码的情况下,暂时禁用一段代码。的例子中,#if 0和#endif将if(a > b) { max = a; } else { max = b; }这段代码注释掉了,所以最终的结果是max没有被赋值,输出时会显示错误值。中的例子中,#if 0和#endif之间的代码也被注释掉了,所以这段代码不会执行。<em>1</em><em>2</em><em>3</em>
#### 引用[.reference_title]
- *1* *2* [#if 0 和 #endif 的用处](https://blog.csdn.net/hello_wordmy/article/details/102469545)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}} ] [.reference_item]
- *3* [if 0 endif的使用](https://blog.csdn.net/qq_44884287/article/details/89513511)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}} ] [.reference_item]
[ .reference_list ]
阅读全文