From: "Morpheus" Newsgroups: comp.os.msdos.djgpp Subject: Re: indexOf function Date: Mon, 22 Nov 1999 14:52:56 -0600 Organization: University of North Texas Lines: 25 Message-ID: <81cafs$6m8@hermes.acs.unt.edu> References: NNTP-Posting-Host: dfw-premium-12.dialup.unt.edu X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Could I use some pointer arithmetic to find the index once I use strstr? If so, I'm not exactly sure how I'd do it. Could you demonstrate? -- Morpheus hall AT cs DOT unt DOT edu http://people.unt.edu/~dahall Eli Zaretskii wrote in message news:Pine DOT SUN DOT 3 DOT 91 DOT 991122131030 DOT 4922B-100000 AT is... > > On Mon, 22 Nov 1999, Morpheus wrote: > > > Does the standard library have an indexOf function for char pointers similar > > to a static version of java's java.lang.String.indexOf()? > > > > As in: > > /* Returns the index of lookFor in lookIn if lookFor is found in lookIn; > > * else returns -1. > > The Standard C library includes a function called `strstr' which does the > same, except that it returns a pointer to the substring if it finds one, > NULL if not.