implementa tú mismo en C las funciones strchr() y strrchr(), pero teniendo en cuenta lo que se debe devolver es el índice de la posición donde encontremos la coincidencia, o bien -1 si no se encuentra.
#include <stdio.h> #include <string.h> /* strchr() */ int strchr1(char *s, int c) { for (int i = 0; i < strlen(s); i++) { if (s[i] == c) { return i; } } return -1; } /* strrchr() */ int strrchr1(char *s, int c) { int len = strlen(s); for (int i = len - 1; i >= 0; i--) { if (s[i] == c) { return i; } } return -1; }