www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/11/22/08:38:26

From: eplmst AT lu DOT erisoft DOT se (Martin Stromberg)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: indexOf function
Date: 22 Nov 1999 09:18:48 GMT
Organization: Ericsson Erisoft AB, Sweden
Lines: 22
Message-ID: <81b1po$7hi$1@antares.lu.erisoft.se>
References: <81au7i$p1f AT hermes DOT acs DOT unt DOT edu>
NNTP-Posting-Host: propus-144.lu.erisoft.se
X-Newsreader: TIN [version 1.2 PL2]
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019