home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_10_12 / 1012014b < prev    next >
Text File  |  1992-10-06  |  246b  |  14 lines

  1. /* strchr function */
  2. #include <string.h>
  3.  
  4. char *(strchr)(const char *s, int c)
  5.     {    /* find first occurrence of c in char s[] */
  6.     const char ch = c;
  7.  
  8.     for (; *s != ch; ++s)
  9.         if (*s == '\0')
  10.             return (NULL);
  11.     return ((char *)s);
  12.     }
  13.  
  14.