Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| Path | csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail |
|---|---|
| NNTP-Posting-Date | Fri, 04 May 2012 18:39:45 -0500 |
| Message-ID | <4FA468BF.3F15@mindspring.com> (permalink) |
| Date | Fri, 04 May 2012 19:39:43 -0400 |
| From | pete <pfiland@mindspring.com> |
| Reply-To | pfiland@mindspring.com |
| Organization | PF |
| X-Mailer | Mozilla 3.04Gold (WinNT; I) |
| MIME-Version | 1.0 |
| Newsgroups | comp.lang.c |
| Subject | Re: strchr with its second argument = 0 |
| References | <jo17lh$g8u$1@news.belwue.de> |
| Content-Type | text/plain; charset=us-ascii |
| Content-Transfer-Encoding | 7bit |
| Lines | 26 |
| X-Usenet-Provider | http://www.giganews.com |
| NNTP-Posting-Host | 4.156.228.57 |
| X-Trace | sv3-quF6aI+pnCCOpD6BuGrxzlSmWD2h+br+J+m8ApzRZkmghcmzVvvGlXiQNUtPD2fCmv+Yxa2C/QspuF2!pSH725SR2IrxwXMThd7va+wSfmOm5s8SvdDZcT+cVyFYeIp+5xXYzT8ubNh/xGJEOh2VygtstCMy!f84hEQbo1w== |
| X-Abuse-and-DMCA-Info | Please be sure to forward a copy of ALL headers |
| X-Abuse-and-DMCA-Info | Otherwise we will be unable to process your complaint properly |
| X-Postfilter | 1.3.40 |
| X-Original-Bytes | 1542 |
| Xref | csiph.com comp.lang.c:20402 |
Show key headers only | View raw
Thomas Richter wrote:
>
> Hi folks,
>
> what is the behavior of strchr if the second argument
> (the character to be searched for) is set to zero?
> Does it find the end of the string, or
> does it find nothing and should it return NULL?
str_chr returns the same values that strchr returns.
char *
str_chr(const char *s, int c)
{
while (*s != (char)c) {
if (*s == '\0') {
s = NULL;
break;
}
++s;
}
return (char *)s;
}
--
pete
Back to comp.lang.c | Previous | Next — Previous in thread | Find similar | Unroll thread
strchr with its second argument = 0 Thomas Richter <thor@math.tu-berlin.de> - 2012-05-04 20:37 +0200
Re: strchr with its second argument = 0 Ralf Damaschke <rwspam@gmx.de> - 2012-05-04 18:45 +0000
Re: strchr with its second argument = 0 Kaz Kylheku <kaz@kylheku.com> - 2012-05-04 19:49 +0000
Re: strchr with its second argument = 0 Kaz Kylheku <kaz@kylheku.com> - 2012-05-04 19:53 +0000
Re: strchr with its second argument = 0 pete <pfiland@mindspring.com> - 2012-05-04 19:31 -0400
Re: strchr with its second argument = 0 Kaz Kylheku <kaz@kylheku.com> - 2012-05-05 02:22 +0000
Re: strchr with its second argument = 0 pete <pfiland@mindspring.com> - 2012-05-04 19:39 -0400
csiph-web