strncmp()

Syntax
  #include <string.h>

  
  char *strncmp(char *p, const char *q, size_t n);

  
Description

strncmp() compares at most the first n characters of the two strings.

Return

A negative integer, if p is smaller than q; zero, if both strings are equal; or a positive integer if p is greater than q.

See also

memcmp()

strcmp()