#include #include #include #include int stricmp(char *s1, char *s2) { char *cmp1, *cmp2; int i; if((cmp1 = malloc(sizeof(char) * strlen(s1) + 1)) == NULL){ perror("Can't alloc memory for stricmp\n"); abort(); } strcpy(cmp1, s1); if((cmp2 = malloc(sizeof(char) * strlen(s2) + 1)) == NULL){ perror("Can't alloc memory for stricmp\n"); abort(); } strcpy(cmp2, s2); for(i = 0; i < strlen(cmp1); i++){ *(cmp1 + i) = toupper(*(cmp1 + i)); } for(i = 0; i < strlen(cmp2); i++){ *(cmp2 + i) = toupper(*(cmp2 + i)); } return strcmp(cmp1, cmp2); }