home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Microsoft Programmer's Library 1.3
/
Microsoft-Programers-Library-v1.3.iso
/
sampcode
/
alde_c
/
misc
/
lib
/
dlibssrc
/
memchr.c
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
NeXTSTEP
RISC OS/Acorn
UTF-8
Wrap
C/C++ Source or Header
|
1987-07-15
|
314 b
|
17 lines
#include <stdio.h>
char *memchr(buf, c, cnt)
register char *buf;
register char c;
register int cnt;
/*
* Search the first <cnt> bytes of <buf> for <c>. Returns a pointer to
* the matching character, or NULL if not found.
*/
{
while(cnt--)
if(*buf++ == c)
return(--buf);
return(NULL);
}