#include<stdio.h>
#define ARRA_SIZE 100
int Find(char *p,char b);
main()
{
char a[ARRA_SIZE],b;
int i,j,pos;
char *p;
printf("Please input a string:\n");
gets(a);
for(j=0;j<ARRA_SIZE;j++)
{
printf("Please input the found character:\n");
scanf("%c",&b);
p=a;
Find(*p,b);
pos=Find(*p,b);
if(pos!=-1)
{
printf("the pos is:\n",pos);
}
else
{
printf("Not found!\n");
}
}
}
int Find(char *p,char b)
{
int pos,i;
for(i=0;i<ARRA_SIZE;i++)
{
if(*(p+i)==b)
{
pos=i;
return(pos);
}
else
{
return(-1);
}
}
}