由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - C++ 无效语句?
相关主题
c++ size_t 一问程序怎么不认识class, namespace等identifier呀?
三个C syntax 弱问题From C++ to C
a question abou dll, 3x!!operator overloading (C++)
来几个C++测试题C++ syntax question
[合集] 编程的习惯问题int F::*x = &F::x是什么意思?
What is wrong in this array declaration.Linq不是syntactic sugar
metaprogrammingPython 缩进的syntax
Question about a C++ compilation error on Visual Studio 2005原来Haskell里面的quasiquoting是来自lisp的
相关话题的讨论汇总
话题: dbptr话题: 语句话题: counter话题: c++
进入Programming版参与讨论
1 (共1页)
d******e
发帖数: 194
1
看到有人的程序里有如下语句:
if(dbPtr || counter || shouldPrintRowCounts) ;
这样的语句有什么用意?
谢谢先
t****t
发帖数: 6806
2
不知道dbPtr, counter, shoudPrintRowCounts是什么类型,不好判断

【在 d******e 的大作中提到】
: 看到有人的程序里有如下语句:
: if(dbPtr || counter || shouldPrintRowCounts) ;
: 这样的语句有什么用意?
: 谢谢先

h****e
发帖数: 2125
3
most likely means:
if (NULL != dbPtr or 0 != counter or true == shouldPrintRowCounts)
do nothing

【在 d******e 的大作中提到】
: 看到有人的程序里有如下语句:
: if(dbPtr || counter || shouldPrintRowCounts) ;
: 这样的语句有什么用意?
: 谢谢先

c**l
发帖数: 12
4
hehe:)good interpretation

【在 h****e 的大作中提到】
: 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 的大作中提到】
: 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 的大作中提到】
: 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 的大作中提到】
: 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 的大作中提到】
: 看到有人的程序里有如下语句:
: if(dbPtr || counter || shouldPrintRowCounts) ;
: 这样的语句有什么用意?
: 谢谢先

a****l
发帖数: 8211
10
it's more like a reminder for future expansion rather than something useful.

【在 d******e 的大作中提到】
: 看到有人的程序里有如下语句:
: if(dbPtr || counter || shouldPrintRowCounts) ;
: 这样的语句有什么用意?
: 谢谢先

g*****z
发帖数: 333
11
也有可能是要实现 shouldPrintRowCounts 这个宏只在指针为空或记数为0时才执行
T******r
发帖数: 257
12
新手用来debug的,忘记删了. 哈哈..

【在 d******e 的大作中提到】
: 看到有人的程序里有如下语句:
: 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 :)
1 (共1页)
进入Programming版参与讨论
相关主题
原来Haskell里面的quasiquoting是来自lisp的[合集] 编程的习惯问题
JAVA的确是要取代C++的What is wrong in this array declaration.
非常喜欢Clojuremetaprogramming
python 本来就是个烂语言,早晚崩盘。Question about a C++ compilation error on Visual Studio 2005
c++ size_t 一问程序怎么不认识class, namespace等identifier呀?
三个C syntax 弱问题From C++ to C
a question abou dll, 3x!!operator overloading (C++)
来几个C++测试题C++ syntax question
相关话题的讨论汇总
话题: dbptr话题: 语句话题: counter话题: c++