...
if (!strcmp(strrchr(str, '\0') - 4, ".avi")){
}
char *strrchr(const char *str, int c) - char , NULL char, . , 4 , 4 .
Then I compare the last 4 characters with ".avi", and if they match, strcmp returns 0 or boolean FALSE, which I invert in my "if" state.
source
share