From: robk AT cyberway DOT com DOT sg (Rob Kramer) Newsgroups: comp.os.msdos.djgpp Subject: Re: Question on 'if' statements... Date: Mon, 17 Jan 2000 10:39:25 +0800 Message-ID: References: <38823564 DOT 37F9F865 AT ou DOT edu> Organization: Infologic Pte Ltd X-Newsreader: Anawave Gravity v2.00 NNTP-Posting-Host: 203.116.150.182 Lines: 22 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com In article <38823564 DOT 37F9F865 AT ou DOT edu>, davidis AT ou DOT edu says... > Hello all, > > I was wondering about how DJGPP would handle a very large if statement > which contained alot of '&&' in it. Does the compiler make it so that > the instant it hits a 'false' value it breaks out, or does it continue > through all of tests and then does the '&&' operation(s) later? I need > to know in order to try and optimize a program that I am writing. Any > help you can give will be greatly appreciated. Thanks for you time. > > -David C. > This is not a compiler issue, but a C language feature as far as I know. The compiler terminates evaluation at the first 'false' in a && expression, or the first 'true' in a || expression. Probably in the C language specs, but I never bothered to look it up :) Cheers, RoB