[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
strncmp() Compare n Characters of Two Strings, Case Sensitive
#include <string.h> Required for declarations only
int strncmp(string1,string2,n);
char *string1;
char *string2;
unsigned int n; Number of characters to compare
strncmp() compares at most the first 'n' characters of 'string1' and
'string2'. The strings are compared lexicographically, and case is
significant (i.e., 'A' != 'a').
Returns: A value indicating the relationship between the two
strings:
Comparison Returned
'string1' < 'string2' < 0.
'string1' == 'string2' 0
'string1' > 'string2' > 0.
Notes: strncmp() expects to operate on null-terminated strings.
No overflow checking is done when strings are copied or
appended.
See Also:
strcmp()
strnicmp()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson