Scrivete la funzione strrindex(s, t), che restituisce la posizione dell'occorrenza più a destra di t in s, oppure -1 se t non compare in s.
Codice:
int strrindex(char s[], char t[]) {
int i, j, k, posizione;
posizione = -1;
for ( i = 0; s[i] != '\0'; i++) {
for (j=i, k=0; t[k] != '\0' && s[j] == t[k]; j++, k++);
if (k > 0 && t[k] == '\0')
posizione = i;
}
return posizione;
}