On Tue, Oct 23, 2007 at 09:23:33AM -0700, Arjan van de Ven wrote:
What does gcc have to say about if (foo = 0){ rather than if (foo == 0){
Both are legal C so it shouldn't say anything. Of course the first is
usually a bug (or very bad style).
On the other hand if (0 = foo) will give an error.
It isn't about how you read in english, it is about not making mistakes.
And why can't you say if 0 is equal to the variable foo rather than if
the variable foo is equal to 0? Both are valid english, so that is just
a crappy excuse for sticking with a bad idea.
--
Len Sorensen
-