Need a C function to compare two string (find out which one is bigger string with case non sensitive)

HI expert -

I need a C functions does the following:

int StringCompare(char* str1, char* str2){
   if (str2 > str1) // jeremy, str2 Kevin
    return 1;
  else return 0;

I know stricmp() can compare two strings, but it only return 1 when two string are different, but compare which string is bigger.  

Please help!
Who is Participating?
ozoConnect With a Mentor Commented:
if( strcmp(str2,str1) > 0 )
strcasecmp(str2,str1) > 0
4eyesgirlAuthor Commented:
you mean stricmp()?

4eyesgirlAuthor Commented:
I didn't realize stricmp() already take care of my issue.  Thanks!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.