#include<stdio.h> #include<string.h> char *mystrchr(char *s,char c) { while(*s) { if(*s == c) { return s; } s++; } return NULL; } int main() { char str[100] = "hello world"; //char* s = strchr(str,'a'); char *s = mystrchr(str,'a'); printf("s = %s ",s); return 0; }