welibc
A clear, secure, and well documented standard C library
Functions
strcmp.c File Reference

Defines the strcmp function. More...

#include <string.h>
Include dependency graph for strcmp.c:

Go to the source code of this file.

Functions

int strcmp (const char *s1, const char *s2)
 Compares the strings pointed to be s1 and s2. More...
 

Detailed Description

Defines the strcmp function.

Definition in file strcmp.c.

Function Documentation

◆ strcmp()

int strcmp ( const char *  s1,
const char *  s2 
)

Compares the strings pointed to be s1 and s2.

Parameters
*s1The first string to be compared
*s2The second string to be compared

The strcmp function compares the string pointed to by s1 to the string pointed to by s2.

Returns
Integer indicating if s1 is greater than, equal to, or less than s2
Return values
>0s1 is greater than s2 or no comparison could be made
0s1 is equal to s2
<0s1 is less than s2

Definition at line 54 of file strcmp.c.

References memcmp(), and strlen().

Here is the call graph for this function: