Path: utzoo!utgpu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!hobbes.physics.uiowa.edu!news.iastate.edu!john From: john@iastate.edu (John Hascall) Newsgroups: alt.hackers Subject: Re: Useful string function Message-ID: <1991Jun29.181821.7443@news.iastate.edu> Date: 29 Jun 91 18:18:21 GMT References: <27187@ttidca.TTI.COM> <27212@ttidca.TTI.COM> <1991Jun27.151946.25284@ima.isc.com> Sender: news@news.iastate.edu (USENET News System) Organization: Iowa State University, Ames, IA Lines: 20 Approved: john@iastate.edu karl@ima.isc.com (Karl Heuer) writes: }To you and all others in your position, I would recommend that you *not* use }Strloc(), because it's better to create your own implementation of strstr() }that agrees with the ANSI specs. Then when strstr() does become ubiquitous... }>(And to those who think they can improve on my code -- go for it. I make }>no claim perfection). ^ to ;-) }char *strstr(register char const *s, register char const *t) { } do { } register char const *ss = s; : While certainly a nice implementation of strstr(), if your compiler is ANSIfied enough to have function prototypes & "const" isn't there a pretty good chance it ANSIfied enough to have strstr() already too? John