Utility Functions and C Language Reference > C Language Reference > Alphabetical List of Functions > strnicmp


Example: strnicmp String Manipulation Functions

Performs an insensitive-case comparison between n characters from string1 and string2 to determine the alphabetic order.

int strnicmp( constchar *string1, const char *string2, size_t num);

string1 The first string that is compared.
string2 The second string that is compared.
num The number of characters to compare.

Return Values

Returns a value indicating the lexicographical relation between the strings:

Return value Description
<0 string1 is less than string2
0 string1 is the same as string2
>0 string1 is greater than string2