Ejemplo n.º 1
0
Archivo: 8.c Proyecto: leicj/books
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;
}
Ejemplo n.º 2
0
int main(void) {
    char string[] = "helloalb";
    char *res;
    res = my_strnchr(string, 'l', 2);
    res++;
    if (*res == 'o') {
        printf("right");
    }
}