-
-
Save parzibyte/2a259b55a84f5de4c12ff8cef30d8ef3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int ultimoIndiceDeCaracterEnCadena(char *cadena, char caracter) | |
{ | |
int indice = strlen(cadena) - 1; | |
while (indice >= 0) | |
{ | |
char actual = cadena[indice]; | |
if (actual == caracter) | |
{ | |
return indice; | |
} | |
indice--; | |
} | |
return -1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment