N
Neil Cerutti
Oh really? What does:
store (a,b);
mean to anyone? Store the contents of a into b or the other
way around?
It would mean one and never the other.
Oh really? What does:
store (a,b);
mean to anyone? Store the contents of a into b or the other
way around?
even better, use memcmp() for all equality comparisons of
integers, and have all magic numbers as constant variables.
Jeremy said:I don't want to belabour the point,
but the former still sounds
unnatural to me.
It denotes value equality, yes, but a variable is not the same /kind/
of thing as a literal, which is why most people do not find "if (x == 1)"
and "if (1 == x)" equally readable, whichever they prefer.
Neither do I. Ultimately, it's a style thing, and no style argument ever got
settled here.
(Given that neither of us is going to persuade the other...) How
do you feel about these code fragments?
if(SUCCESS == rc)
if(Success == rc)
if(success == rc)
I'm just curious. I ***promise*** I won't argue with your reply (because
it's a style thing, so I'm taking it as read that we've agreed to differ).
Arthur J. O'Dwyer said:.... snip ...
First off, all of them should have whitespace between the keyword
'if' and the open parenthesis '('. 'if', like 'sizeof' and
'return', is not a function.
Arthur said:First off, all of them should have whitespace between the keyword
'if' and the open parenthesis '('. 'if', like 'sizeof' and 'return',
is not a function.
Not really. The = sign in mathematics just means something slightly
different than it does in C. If you want Pascal or BASIC, you know
where to find them. (The mathematical = relation is equivalent to the
C == operator, and indeed in C (i == i+1) has no solution for
unsigned integral i.)
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.