Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Zortech C++ 3.0r4 - <b>strncmpl</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
strncmpl
strnicmp

Usage

   #include <string.h>
   int strncmpl(char *str1,char *str2,int n);
   int strnicmp(char *str1,char *str2,int n);

Description

   This function is a case-insensitive version of strncmp(). The first N
   characters of each string are compared. If either string is less than N
   characters long, the comparison is terminated and the return value
   represents the results of the comparison up until the termination. The
   returned value is zero for a successful match, or else a positive or
   negative number representing the difference in the mismatching
   characters. strncmpl is implemented as a macro in string.h. strnicmp is
   provided for compatibility with other compilers.

Example 

   #include <string.h>
   #include <stdlib.h>

   int main()
   {
       r = strncmpl("abc","ABCD",3); /* returns 0  */
       r = strncmpl("abc","ABCD",6); /* returns 0  */
       r = strncmpl("abc","ABCX",6); /* returns 0  */
       r = strncmpl("abcx","ABC",6); /* returns 0  */
       r = strnicmp("abc","ABX",2);  /* returns 0  */
       r = strnicmp("abc","ABX",3);  /* returns -21    */
       r = strnicmp("abx","ABC",6);  /* returns 21 */

       return EXIT_SUCCESS;
   }

Return Value

   0 if first n bytes match, else positive if str1 > str2 or negative if
   str1 < str2.

See Also

   strncmp



See Also: strncmp

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