home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frozen Fish 1: Amiga
/
FrozenFish-Apr94.iso
/
bbs
/
alib
/
d2xx
/
d222
/
plplot.lha
/
Plplot
/
src
/
source.zoo
/
strpos.c
< prev
next >
Wrap
C/C++ Source or Header
|
1989-05-15
|
487b
|
20 lines
/* 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);
}