home *** CD-ROM | disk | FTP | other *** search
- /*
- * strcfind.c
- * contains: strcfind()
- *
- */
-
- #include <stdio.h>
- #include "gfuncts.h"
-
- /*
- * int
- * strcfind(str,c)
- *
- * ARGUMENT
- * (char *) str - pointer to string to examine
- * (char) c - character to locate in string
- *
- * DESCRIPTION
- * The indicated string is searched left to right for the first occurrence
- * of the character indicated by c.
- *
- * RETURNS
- * Position of character if found, -1 if not found in string.
- *
- * AUTHOR
- * Copyright (C)1987-1990 Greenleaf Software Inc. All Rights Reserved.
- */
- int GF_CONV strcfind(p,c)
- char c,*p;
- {
- int i=0;
-
- while(*p)
- if(*p==c)
- return i;
- else {
- ++i;
- ++p;
- }
- return (-1);
- }
-