#include "stdio.h"
#include "string.h"
char *strchr(char *s,char c);
main()
{
char *str[128],a;
printf("请输入一个字符串:\n");
scanf("%s",str);
getchar();
printf("请输入一个字符:\n");
scanf("%c",&a);
printf("现在的位置是:\n");
printf("%s\n",strchr((char*)str,a));
}
char *strchr(char *s,char c)
{
unsigned i;
for(i=0;i
if(s[i]==c)
{
return s+i;
break;
}
}
if(i>=strlen(s))return NULL;
}