home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / d / dec92.zip / 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.