home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / d / dec92.zip / 1012018B < prev    next >
Text File  |  1992-10-06  |  314b  |  18 lines

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