🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: be.comp.programming
Article #5760

Re: string

#5760
From: Serve Laurijssen
Date: Sun, 09 Mar 2003 16:31
18 lines
1873 bytes
"Dominique Devriese" <dominique.devriese@student.kuleuven.ac.be> wrote in
message news:87d6l0zfb4.fsf@appel.kotnet.org...
> Ivan Van den Bossche writes:
>
>   Ivan> Hi, Kan er mij iemand vertellen welke functie ik in C moet
>   Ivan> gebruiken om:
>
>   Ivan> een waarde terug te krijgen van de index van de eerste
>   Ivan> karakter in een bepaalde substring die voorkomt in een gegeven
>   Ivan> string?  In Delphi bestaat er een Pos functie.  Welke is deze
>   Ivan> in de programmeertaal C?
>
> strchr

bijna, die stuurt een pointer terug en zoekt naar een letter.
char *p = strstr(s, "bleat");
size_t pos = p ? p - s : -1;
Technical Details
Message-ID: <b4fq8d$39$1@news2.tilbu1.nb.home.nl>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!skynet.be!skynet.be!213.51.129.3.MISMATCH!newshub1.home.nl!home.nl!not-for-mail
References: <_LJaa.3647$Vq.390@afrodite.telenet-ops.be> <87d6l0zfb4.fsf@appel.kotnet.org>

Show Full Headers
Complete Article Headers
X-Google-Language: DUTCH,ASCII-7-bit
X-Google-Thread: 107324,37a026138681813
X-Google-Attributes: gid107324,public
X-Google-Thread: fcea4,37a026138681813
X-Google-Attributes: gidfcea4,public
X-Google-ArrivalTime: 2003-03-09 08:31:18 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!skynet.be!skynet.be!213.51.129.3.MISMATCH!newshub1.home.nl!home.nl!not-for-mail
From: "Serve Laurijssen" <oh@ja.nl>
Newsgroups: be.comp.programming,nl.comp.programmeren
Subject: Re: string
Date: Sun, 9 Mar 2003 17:31:16 +0100
Organization: @Home Benelux
Lines: 20
Message-ID: <b4fq8d$39$1@news2.tilbu1.nb.home.nl>
References: <_LJaa.3647$Vq.390@afrodite.telenet-ops.be> <87d6l0zfb4.fsf@appel.kotnet.org>
NNTP-Posting-Host: cp179079-a.tilbu1.nb.home.nl
X-Trace: news2.tilbu1.nb.home.nl 1047227469 105 217.120.117.137 (9 Mar 2003 16:31:09 GMT)
X-Complaints-To: abuse@home.nl
NNTP-Posting-Date: Sun, 9 Mar 2003 16:31:09 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106