Compares substrings.
#include <string.h> int strncmp(const char *string1, const char *string2, size_t count); int _strncmp(const char *string1, const char *string2, size_t count);
#include <wchar.h>
int wcsncmp(const wchar_t *string1, const wchar_t *string2, size_t count);
string1
, string2
count
The strncmp function performs an ordinal comparison of at most the first count characters in string1 and string2 and returns a value indicating the relationship between the substrings. _strncmp is an alternate name for strncmp.
wcsncmp is a wide-character version of strncmp.
A value indicating the relationship between the substrings:
Value | Description |
---|---|
< 0 | string1 less than string2 |
= 0 | string1 equal to string2 |
> 0 | string1 greater than string2 |
tchar.h routine |
_UNICODE not defined |
_UNICODE defined |
---|---|---|
_tcsncmp | strncmp | _wcsncmp |
Versions | Defined in | Include | Link to |
---|---|---|---|
INtime 3.0 INtime 6.0 (for wide-character and generic text versions) |
intime/rt/include/string.h intime/rt/include/wchar.h intime/rt/include/tchar.h |
string.h wchar.h tchar.h |
clib.lib |