|
|
1.1 ! root 1: #ifndef lint ! 2: static char sccsid[] = "@(#)index.c 5.1 (Berkeley) 7/2/83"; ! 3: #endif ! 4: ! 5: #include <stdio.h> ! 6: ! 7: /******* ! 8: * char * ! 9: * index(str, c) return pointer to character c ! 10: * char c, *str; ! 11: * ! 12: * return codes: ! 13: * NULL - character not found ! 14: * pointer - pointer to character ! 15: */ ! 16: ! 17: char * ! 18: index(str, c) ! 19: register char c, *str; ! 20: { ! 21: for (; *str != '\0'; str++) { ! 22: if (*str == c) ! 23: return(str); ! 24: } ! 25: ! 26: return(NULL); ! 27: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.