dev/c/ToUpperTest/main.c

24 lines
516 B
C
Raw Normal View History

#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <stdlib.h>
#define MaxLen 1024
char STR1[1024], STR2[1024];
int strcomp(const char * str1, const char * str2)
{
char * p1 = STR1, * p2 = STR2;
while(*p1++=toupper(*str1++));
while(*p2++=toupper(*str2++));
return strcmp(STR1,STR2);
return 0;
}
int main(int argc, char * argv[])
{
printf("%d\n", strcomp("Hello\0","heLLo\0"));
printf("%d\n", strcomp("aello\0","BeLLo\0"));
printf("%d\n", strcomp("bello\0","AeLLo\0"));
return 0;
}