hi, i wrote the strchr function in a full program but there is something wrong when calling the function and it gives me an expected error , here is the code :
Code:#include <string.h> #include <stdio.h> #include <conio.h> void strchr(*s, char c) { while (*s != '\0' && *s != (char)c) s++; return ( (*s == c) ? (char *) s : NULL ); } main() { char s[5],c; scanf("%s",&s); strchr(&s,c); printf("%s",s); getch(); }