From: "Morpheus" Newsgroups: comp.os.msdos.djgpp Subject: indexOf function Date: Mon, 22 Nov 1999 02:17:30 -0600 Organization: University of North Texas Lines: 21 Message-ID: <81au7i$p1f@hermes.acs.unt.edu> NNTP-Posting-Host: dfw-premium-69.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 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. */ int indexOf(char* lookIn, char* lookFor); That I could use like this: char* p = "This and that."; char* q = "that"; int i = indexOf(p, q); // so p[i...i+3] = "that" -- Morpheus hall AT cs DOT unt DOT edu http://people.unt.edu/~dahall