7.21.4.4 The strncmp function

Synopsis

1

#include <string.h>
int strncmp(const char *s1, const char *s2, size_t n);

Description

2

The strncmp function compares not more than n characters (characters that follow a null character are not compared) from the array pointed to by s1 to the array pointed to by s2.

Returns

3

The strncmp function returns an integer greater than, equal to, or less than zero, accordingly as the possibly null-terminated array pointed to by s1 is greater than, equal to, or less than the possibly null-terminated array pointed to by s2.