Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Janis Papanagnou Newsgroups: comp.lang.c Subject: Re: while(T[l]

References: MIME-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Injection-Date: Thu, 28 Mar 2024 15:26:02 +0100 (CET) Injection-Info: dont-email.me; posting-host="155435c3f40053ae5c3f5cbd325b2209"; logging-data="3849394"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18lgEyRLfSAgzmJaKQ5AXCT" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 Cancel-Lock: sha1:3NzJnIVnlMIljc20f1SzGTzUUVI= X-Enigmail-Draft-Status: N1110 In-Reply-To: Bytes: 2985 On 28.03.2024 13:18, fir wrote: > Janis Papanagnou wrote: >> On 27.03.2024 12:35, fir wrote: >>> tell me, is while(T[l]

> >> [...] If >> you don't want to operate on bits but want to express a boolean >> conjunction you should use '&&', though. > > [...] > > hovever i wopuld disagre to use "&&" instead "&" then > && look much worse (Well, I think that '+' looks much worse than '*', but in math expressions I use the _appropriate_ operator anyway.) Mind that '&' is *not* a syntactical variant of '&&'... > and probably & has no real disadvantages it is different to '&&', it has another semantic! As said, it's just by context-coincidence that it's equivalent _here_. > (i mean no > bigger that the intention that && should be use for boolean - which > probably comes from later c not oryginal young c Original K&R C had '&' for bit-operations and '&&' for boolean operations. While, say, 'x bool). > > so i probably plan to stick to & But why stick to a bit-value operator where you want a boolean logic operator? - You just confuse readers of your code and unnecessarily introduce error-prone code. (But you can of course do as you like.) Janis