strncmp


Character string comparison (with number of characters specified)

[Classification]

Standard library

[Syntax]

#include <string.h>

int strncmp(const char *s1, const char *s2, size_t length);

[Return value]

Returns an integer greater than, equal to, or less than 0, depending on whether the character string indicated by s1 is greater than, equal to, or less than the character string indicated by s2.

[Description]

This function compares up to length characters of the array indicated by s1 with characters of the array indicated by s2.