d******e 发帖数: 194 | 1 看到有人的程序里有如下语句:
if(dbPtr || counter || shouldPrintRowCounts) ;
这样的语句有什么用意?
谢谢先 |
t****t 发帖数: 6806 | 2 不知道dbPtr, counter, shoudPrintRowCounts是什么类型,不好判断
【在 d******e 的大作中提到】![](/moin_static193/solenoid/img/up.png) : 看到有人的程序里有如下语句: : if(dbPtr || counter || shouldPrintRowCounts) ; : 这样的语句有什么用意? : 谢谢先
|
h****e 发帖数: 2125 | 3 most likely means:
if (NULL != dbPtr or 0 != counter or true == shouldPrintRowCounts)
do nothing
【在 d******e 的大作中提到】![](/moin_static193/solenoid/img/up.png) : 看到有人的程序里有如下语句: : if(dbPtr || counter || shouldPrintRowCounts) ; : 这样的语句有什么用意? : 谢谢先
|
c**l 发帖数: 12 | 4 hehe:)good interpretation
【在 h****e 的大作中提到】![](/moin_static193/solenoid/img/up.png) : most likely means: : if (NULL != dbPtr or 0 != counter or true == shouldPrintRowCounts) : do nothing
|
t****t 发帖数: 6806 | 5 since it's c++, it may involve some user-defined type conversion. so it's
difficult to say...
【在 h****e 的大作中提到】![](/moin_static193/solenoid/img/up.png) : most likely means: : if (NULL != dbPtr or 0 != counter or true == shouldPrintRowCounts) : do nothing
|
d******e 发帖数: 194 | 6 dbPtr is a pointer, counter is an integer, the other one is bool.
sure, the syntax is simple and makes sense, The problem is I don't
understand what effect this statement has. It does not seem to have any
effect since the evalued result is not used in any way. |
t****t 发帖数: 6806 | 7
if so, then the statement doesn't make much sense.
【在 d******e 的大作中提到】![](/moin_static193/solenoid/img/up.png) : dbPtr is a pointer, counter is an integer, the other one is bool. : sure, the syntax is simple and makes sense, The problem is I don't : understand what effect this statement has. It does not seem to have any : effect since the evalued result is not used in any way.
|
d******e 发帖数: 194 | 8 that's what I am thinking, but I need to make sure. Thanks for the answer.
【在 d******e 的大作中提到】![](/moin_static193/solenoid/img/up.png) : dbPtr is a pointer, counter is an integer, the other one is bool. : sure, the syntax is simple and makes sense, The problem is I don't : understand what effect this statement has. It does not seem to have any : effect since the evalued result is not used in any way.
|
d*z 发帖数: 150 | 9 也许这里
shouldPrintRowCounts是一个复杂的宏?
不过如果这样,显然这个宏定义的不是很好,应该定义成看起来像一个函数更好一些
【在 d******e 的大作中提到】![](/moin_static193/solenoid/img/up.png) : 看到有人的程序里有如下语句: : if(dbPtr || counter || shouldPrintRowCounts) ; : 这样的语句有什么用意? : 谢谢先
|
a****l 发帖数: 8211 | 10 it's more like a reminder for future expansion rather than something useful.
【在 d******e 的大作中提到】![](/moin_static193/solenoid/img/up.png) : 看到有人的程序里有如下语句: : if(dbPtr || counter || shouldPrintRowCounts) ; : 这样的语句有什么用意? : 谢谢先
|
g*****z 发帖数: 333 | 11 也有可能是要实现 shouldPrintRowCounts 这个宏只在指针为空或记数为0时才执行 |
T******r 发帖数: 257 | 12 新手用来debug的,忘记删了. 哈哈..
【在 d******e 的大作中提到】![](/moin_static193/solenoid/img/up.png) : 看到有人的程序里有如下语句: : if(dbPtr || counter || shouldPrintRowCounts) ; : 这样的语句有什么用意? : 谢谢先
|
p**********g 发帖数: 187 | 13 first check if any is macro. if not, set a break point here and step into to
see whether anything is called :) |