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/stricmp.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/stricmp.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/stricmp.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/stricmp.html on line 8
Compare two strings, ignoring case
#include <string.h>
int stricmp( const char* s1,
const char* s2 );
- s1, s2
- The strings that you want to compare.
libc
Use the -l c option to
qcc
to link against this library.
This library is usually included automatically.
The stricmp() function compares,
with case insensitivity, the string pointed to by s1 to the string
pointed to by s2. All uppercase characters from s1
and s2 are mapped to lowercase for the purposes of doing the
comparison.
- < 0
- s1 is less than s2.
- 0
- s1 is equal to s2.
- > 0
- s1 is greater than s2.
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main( void )
{
printf( "%d\n", stricmp( "AbCDEF", "abcdef" ) );
printf( "%d\n", stricmp( "abcdef", "ABC" ) );
printf( "%d\n", stricmp( "abc", "ABCdef" ) );
printf( "%d\n", stricmp( "Abcdef", "mnopqr" ) );
printf( "%d\n", stricmp( "Mnopqr", "abcdef" ) );
return EXIT_SUCCESS;
}
produces the output:
0
100
-100
-12
12
QNX 4
Safety: | |
Cancellation point |
No |
Interrupt handler |
Yes |
Signal handler |
Yes |
Thread |
Yes |
strcasecmp(),
strcmp(),
strcmpi(),
strcoll(),
strncasecmp(),
strncmp(),
strnicmp(),
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/stricmp.html on line 163
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/stricmp.html on line 163