Exemple #1
0
Fichier : 8.c Projet : 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;
}
Exemple #2
0
int main(void) {
    char string[] = "helloalb";
    char *res;
    res = my_strnchr(string, 'l', 2);
    res++;
    if (*res == 'o') {
        printf("right");
    }
}