Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/s/strnicmp.html on line 1

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/s/strnicmp.html on line 1

Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/s/strnicmp.html on line 8

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/s/strnicmp.html on line 8

strnicmp()

Compare two strings up to a given length, ignoring case

Synopsis:

#include <string.h>

int strnicmp( const char* s1,
              const char* s2,
              size_t len );

Arguments:

s1, s2
The strings that you want to compare.
len
The maximum number of characters that you want to compare.

Library:

libc

Use the -l c option to qcc to link against this library. This library is usually included automatically.

Description:

The strnicmp() function compares up to len characters from the strings pointed to by s1 and s2, ignoring case.

Returns:

< 0
s1 is less than s2.
0
s1 is equal to s2.
> 0
s1 is greater than s2.

Examples:

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

int main( void )
  {
    printf( "%d\n", strnicmp( "abcdef", "ABCXXX", 10 ) );
    printf( "%d\n", strnicmp( "abcdef", "ABCXXX",  6 ) );
    printf( "%d\n", strnicmp( "abcdef", "ABCXXX",  3 ) );
    printf( "%d\n", strnicmp( "abcdef", "ABCXXX",  0 ) );
    return EXIT_SUCCESS;
  }

produces the output:

-20
-20
0
0

Classification:

QNX 4

Safety:
Cancellation point No
Interrupt handler Yes
Signal handler Yes
Thread Yes

See also:

strcasecmp(), strcmp(), strcmpi(), strcoll(), stricmp(), strncasecmp(), strncmp(), wcscmp(), wcscoll(), wcsncmp()


Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/s/strnicmp.html on line 164

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/s/strnicmp.html on line 164