Path: utzoo!attcan!utgpu!utstat!jarvis.csri.toronto.edu!mailrus!uunet!crdgw1!crdos1!davidsen From: davidsen@crdos1.crd.ge.COM (Wm E Davidsen Jr) Newsgroups: comp.lang.c Subject: Re: compare strings, strcmp Keywords: strcmp,strings Message-ID: <1633@crdos1.crd.ge.COM> Date: 16 Nov 89 19:30:02 GMT References: <4463@blake.acs.washington.edu> <11605@smoke.BRL.MIL> <308@charyb.COM> <5205@mentor.cc.purdue.edu> Reply-To: davidsen@crdos1.UUCP (bill davidsen) Organization: GE Corp R&D Center, Schenectady NY Lines: 14 In article <5205@mentor.cc.purdue.edu> aic@mentor.cc.purdue.edu (George A. Basar) writes: | It is not unsafe, it is just that he was looking for a a way to not | perform the strcmp if the first chars were unequal. He stated it was | unsafe(performance-wise) since the order of evaluation is suspect. So the ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | strcmp may be performed before the test for *(a)==*(b). Not in C, it's not. && is evaluated left to right. -- bill davidsen (davidsen@crdos1.crd.GE.COM -or- uunet!crdgw1!crdos1!davidsen) "The world is filled with fools. They blindly follow their so-called 'reason' in the face of the church and common sense. Any fool can see that the world is flat!" - anon