Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!princeton!caip!seismo!lll-crg!styx!nike!cad!ucbvax!hplabs!felix!peregrine!mike From: mike@peregrine.UUCP (Mike Wexler) Newsgroups: net.lang.c Subject: Re: Boolean Operators Slighted in C Message-ID: <392@peregrine.UUCP> Date: Tue, 27-May-86 18:19:47 EDT Article-I.D.: peregrin.392 Posted: Tue May 27 18:19:47 1986 Date-Received: Fri, 30-May-86 04:58:02 EDT References: <822@brl-smoke.ARPA> Reply-To: mike@peregrine.UUCP (Mike Wexler) Organization: Peregrine Systems, Irvine, Ca Lines: 27 Keywords: if boolean integer Summary: finding integer expression used in an if statement In article <822@brl-smoke.ARPA> rbj@icst-cmr (Root Boy Jim) writes: > Boolean quantities form an important abstract data type distinct from > counters, sets, real numbers, etc. By not making the distinction, > the language encourages usage errors, the most notorious being > if ( a = b ) > stuff; > >True. It is easily found tho. ------ How do I easily find these? Given the following pseudocode fragment int xyz(parameter1,parameter2) { ... if (big_expression_1=big_expression_2) statement; ... } Where the "=" should be a "==" and the function is producing unexpected results how would you easily track down this failure. By easily I mean more easily than compiling the program and noticing the error about using an arithmetic expression where a boolean one was supposed to be. If this isn't what you meant by easily, what did you mean? -- Mike Wexler Email address:(trwrb|scgvaxd)!felix!peregrine!mike Tel Co. address: (714)855-3923 ;-) Internet address: ucivax@ucbvax.BERKELY.EDU!ucivax%felix!mike@peregrine :-(