Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: Using == operator Date: Mon, 02 Jan 2017 15:57:05 -0800 Organization: None to speak of Lines: 20 Message-ID: References: <4598b1a6-e647-4327-85d8-23f83198d0c6@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="f1ffbb62f7d4ea154aec5923c7307730"; logging-data="11404"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX183+YSANXaccMcHfcFj9iNL" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:Yzw1a4MRQYILGl4FgX8u6TVKXCk= sha1:0wg/GF0zxa1DREGpWuj8p3gMjJ8= Xref: csiph.com comp.lang.c:100933 Malcolm McLean writes: [...] > Also > if(node->next) > > reads like English. Does it? C has the convention that using a value as a condition implicitly compares that value to zero. English has no such convention. For example, suppose I have a bag that may or may not contain any apples. In C, you can say either "if (apple_count != 0)" or "if (apple_count)". In English, "If the number of apples in the bag then ..." doesn't make sense. -- Keith Thompson (The_Other_Keith) kst-u@mib.org Working, but not speaking, for JetHead Development, Inc. "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"