fork download
  1. #include <stdio.h>
  2. #include <string.h>
  3. #include <ctype.h>
  4.  
  5. int nocasecmp(const char *s1, const char *s2) {
  6. while (tolower(*s1) == tolower(*s2)) {
  7. printf("%c == %c\n", *s1, *s2);
  8. if (0 == *s1++ == *s2++) return 0;
  9. }
  10. return tolower(*s1) - tolower(*s2);
  11. }
  12.  
  13.  
  14. int main(void) {
  15. printf("%d", nocasecmp("LG", "la"));
  16. return 0;
  17. }
  18.  
Success #stdin #stdout 0s 5256KB
stdin
Standard input is empty
stdout
L == l
6