www.delorie.com/djgpp/doc/libc/libc_564.html   search  
libc.a reference

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

memchr

Syntax

 
#include <string.h>

void *memchr(const void *string, int ch, size_t num);

Description

This function searches num bytes starting at string, looking for the first occurence of ch.

Return Value

A pointer to the first match, or NULL if it wasn't found.

Portability

ANSI/ISO C C89; C99
POSIX 1003.2-1992; 1003.1-2001

Example

 
if (memchr(path, '/', strlen(path))
  do_slash();


  webmaster     delorie software   privacy  
  Copyright © 2004     Updated Apr 2004