| cvs.gedasymbols.org/archives/browse.cgi | search |
| From: | "Morpheus" <hall AT silo DOT csci DOT unt DOT edu> |
| Newsgroups: | comp.os.msdos.djgpp |
| Subject: | Re: indexOf function |
| Date: | Mon, 22 Nov 1999 14:50:15 -0600 |
| Organization: | University of North Texas |
| Lines: | 33 |
| Message-ID: | <81caar$6m5@hermes.acs.unt.edu> |
| References: | <81au7i$p1f AT hermes DOT acs DOT unt DOT edu> <81b1po$7hi$1 AT antares DOT lu DOT erisoft DOT se> |
| 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 |
I already know of strstr, and it does not do the same thing. Thanks, anyway. -- Morpheus hall AT cs DOT unt DOT edu http://people.unt.edu/~dahall Martin Stromberg <eplmst AT lu DOT erisoft DOT se> wrote in message news:81b1po$7hi$1 AT antares DOT lu DOT erisoft DOT se... > Morpheus (hall AT cs DOT unt DOT edu) 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. > : */ > : 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" > > strstr()? > > > Right, > > MartinS
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |