Compare the first few characters of two strings
Integer_Type strncmp (String_Type a, String_Type b, Integer_Type n)
This function behaves like strcmp except that it compares only the
first n characters in the strings a and b. See
the documentation for strcmp for information about the return
value.
The expression
strcmp ("apple", "appliance", 3);
will return zero since the first three characters match.
strcmp, strlen