home *** CD-ROM | disk | FTP | other *** search
- /* Searches string str for first occurence of character chr. If found */
- /* the position of the character in the string is returned (the first */
- /* character has position 0). If the character is not found a -1 is */
- /* returned. */
-
- #include "plplot.h"
- #include <stdio.h> /* Needed to define NULL */
- #include <string.h>
-
- int strpos(str,chr)
- char *str,chr;
- {
- char *temp;
-
- if ( (temp = strchr(str,chr)) != NULL)
- return(temp - str);
- else
- return(-1);
- }
-