strcmp()

Syntax
  #include <string.h>

  
  int strcmp(const char *p, const char *q);

  
Description

strcmp() compares the two strings, using the character ordering given by the ASCII character set.

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.

Note: The return value of strcmp() can be used as a comparison function in bsearch() and qsort().
See also

memcmp()

strcoll()

strncmp()