strcmp

Compare two strings.

int strcmp (char * string1, char * string2);

Required Header
<string.h>

Return Value

An integer describing relation between the strings as described in the Remarks section.

Parameters

string1

  A string

string2

  A string

Remarks

The strcmp function returns the following:

< 0 string1 is less than string2
= 0 string1 equals string2
> 0 string1 is greater than string2

String

See Also    memcmp, strcat, _stricmp, strncmp, strlen