Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!cs.utexas.edu!wuarchive!udel!princeton!phoenix.Princeton.EDU!pfalstad From: pfalstad@phoenix.Princeton.EDU (Paul John Falstad) Newsgroups: comp.lang.c Subject: Re: Comparing strings... Message-ID: <3330@idunno.Princeton.EDU> Date: 13 Oct 90 22:51:40 GMT References: <1990Oct13.190106.15615@ux1.cso.uiuc.edu> Sender: news@idunno.Princeton.EDU Organization: Princeton University, Princeton, New Jersey Lines: 23 In article stanley@fozzie.pheonix.com (John Stanley) writes: >gordon@osiris.cso.uiuc.edu (John Gordon) writes: >> Hmmm... Well, here's what I came up with: > Did I miss something, or is everyone overlooking the library functions >strcmp and strncmp that are already provided to do this? You're not missing anything. You're just the only one who bothered to post the obvious. Here's a better implementation of strcmp, by the way: (not that it matters, since it's in the library) int strcmp(char *s,char *t) { for (; *s && *s == *t; s++,t++); return *s-*t; } -- pfalstad@phoenix.princeton.edu The Germans are disputing it! Hegel is arguing that the reality is merely an a priori adjunct of non-absolutistic ethics; Kant, by the categorical imperative, is holding it ontologically exists only in the imagination; and Marx is claiming it was off sides.