Path: utzoo!utgpu!watmath!att!rutgers!ucsd!tut.cis.ohio-state.edu!purdue!mentor.cc.purdue.edu!aic From: aic@mentor.cc.purdue.edu (George A. Basar) Newsgroups: comp.lang.c Subject: Re: compare strings, strcmp Summary: correction Keywords: strcmp,strings Message-ID: <5221@mentor.cc.purdue.edu> Date: 16 Nov 89 21:38:11 GMT References: <4463@blake.acs.washington.edu> <11605@smoke.BRL.MIL> <308@charyb.COM> <5205@mentor.cc.purdue.edu> Organization: Buckaroo Banzai Institute Lines: 19 In article <5205@mentor.cc.purdue.edu>, aic@mentor.cc.purdue.edu I write: > 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 I blew it, apologies to all. No excuse given. This is not unsafe for the application specified, though, which was a fixed array of strings(aasuming a calling convention of StrEq(a[i],b[i])). There are many ways to optimize a solution to a specific problem that would fail in other cases. Once again, sorry. Revoke my cc rights and make me use fortran :-). * George A. Basar (317)742-8799 (home) * aic@mentor.cc.purdue.edu BASAR@PURCCVM.BITNET | General Consultant (317)494-1787 (work) | Purdue University Computing Center Discalimer: My opinions are just that, mine.