Guardian C Library Calls Reference Manual

Reference to Library Calls
Guardian TNS C Library Calls Reference Manual128833 3-203
strncmp
strncmp
The strncmp function compares two strings alphabetically for a given maximum number
of characters.
str1_ptr
points to the first string to compare.
str2_ptr
points to the second string to compare.
max
specifies the maximum number of characters to compare. max must be a positive
integer.
Return Value
is zero if the two strings are equal, a negative value if *str1_ptr is less than
*str2_ptr, or a positive value if *str1_ptr is greater than *str2_ptr.
Usage Guidelines
If the first string has fewer max characters and matches the beginning of the second
string, the first string is considered less than the second string.
#include <stringh>
int strncmp(const char *str1_ptr, const char *str2_ptr,
size_t max);