#include #include int StrLen(char *string) { int count = 0; while (*string) { count++; string++; } return count; } int StrEnd(char *s,char *t) { int booleano = 0; int tamT = StrLen(t) ; int tamanhoMinimo = tamT; int tamS = StrLen(s) ; while(tamanhoMinimo) { if(s[tamS] == t[tamT]) { booleano = 1; tamS--; tamT--; tamanhoMinimo--; } else { booleano = 0; break; } } return booleano; } int main() { char stringS[20] = "PaloHenrque"; char stringT[20] = "Henrque"; int resultado = StrEnd(stringS, stringT); //printf("%d \t %d", StrLen(stringS), StrLen(stringT)); printf("%d", resultado); return 0; }