问题描述
在C ++(gcc,VS)中,NULL被认为与False相同。或者更重要的是,如果在逻辑语句中,NULL求值。还有一些其他问题,但没有一个C ++专门。
In C++ (gcc,VS) is NULL considered the same as False. Or more importantly if in a logical statement what does NULL evaluate to. There were a number of other questions but none for C++ specifically.
由于某种原因,使用(;;)的NULL控制循环只冻结程序,表明在;;之间有一个非NULL的东西。注意这段代码是我们的教授认为包含NULL值的东西。
For some reason looping with a NULL control for(;;) just freezes up the program indicating that there is something other than a NULL placed between the ;;. Note this code is something our professor believes to contain NULL values.
推荐答案
我相信NULL通常被定义为0,当用作布尔表达式时,计算结果为false。
I believe NULL is generally defined to be 0, which coincidentally evaluates to false when used as a boolean expression.
这篇关于在C ++中,NULL与False相同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!