int main(void) { char str[] = "hello world"; printf("%s\n", my_strnchr(str, 'o', 1)); printf("%s\n", my_strnchr(str, 'o', 2)); printf("%s\n", my_strnchr(str, 'o', 3)); return 0; }
int main(void) { char string[] = "helloalb"; char *res; res = my_strnchr(string, 'l', 2); res++; if (*res == 'o') { printf("right"); } }