Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Microsoft C 6.0 - <b>strcmpi() compare two strings, case insensitive</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 strcmpi()               Compare Two Strings, Case Insensitive

 #include   <string.h>                   Required for declarations only

 int        strcmpi(string1,string2);
 const char *string1;                    First string
 const char *string2;                    Second string

    strcmpi() performs a case-insensitive, lexicographic comparison of
    'string1' and 'string2' ( 'a' is less than 'b', 'b' is equal to 'b',
    and 'c' is greater than 'b' but, because strcmpi() is
    case-insensitive, 'a' is equal to 'A').

    Returns:    A value indicating the relationship between the two
                strings:

                      Comparison          Returned

                'string1' <  'string2'      < 0
                'string1' == 'string2'        0
                'string1' >  'string2'      > 0

      Notes:    strcmpi() is identical to stricmp().

                strcmpi() expects to operate on null-terminated strings.

 Portability:   strcmpi() is a Microsoft extension to the ANSI standard;
                it should not ber used when ANSI compatibility is
                required.

   -------------------------------- Example ---------------------------------

    In this example, the two strings compared are equivalent.

           #include <stdio.h>

           char str1[25] = "a quick brown fox";
           char str2[25] = "A Quick Brown Fox";
           int rslt;

           main()
           {
                 rslt = strcmpi(str1,str2);
                 if (rslt == 0)
                    printf("strings are identical");
                 else
                     printf("strings do not match");
           }


See Also: strcmp()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson