home *** CD-ROM | disk | FTP | other *** search
/ minnie.tuhs.org / unixen.tar / unixen / PDP-11 / Trees / V7 / usr / src / cmd / uucp / index.c < prev    next >
Encoding:
C/C++ Source or Header  |  1979-01-10  |  321 b   |  25 lines

  1. #include <stdio.h>
  2.  
  3.  
  4. /*******
  5.  *    char *
  6.  *    index(str, c)    return pointer to character c
  7.  *    char c, *str;
  8.  *
  9.  *    return codes:
  10.  *        NULL  -  character not found
  11.  *        pointer  -  pointer to character
  12.  */
  13.  
  14. char *
  15. index(str, c)
  16. char c, *str;
  17. {
  18.     for (; *str != '\0'; str++) {
  19.         if (*str == c)
  20.             return(str);
  21.     }
  22.  
  23.     return(NULL);
  24. }
  25.