welibc
A clear, secure, and well documented standard C library
|
Defines the strncmp function. More...
#include <string.h>
Go to the source code of this file.
Functions | |
int | strncmp (const char *s1, const char *s2, size_t n) |
Compares the strings pointed to be s1 and s2. More... | |
Defines the strncmp function.
Definition in file strncmp.c.
int strncmp | ( | const char * | s1, |
const char * | s2, | ||
size_t | n | ||
) |
Compares the strings pointed to be s1 and s2.
*s1 | The first string to be compared |
*s2 | The second string to be compared |
n | Maximum number of characters to be compared |
The strncmp function compares note more than n characters (characters that follow a null character are not compared) from the array pointed to by s1 to the array pointed to by s2.
>0 | s1 is greater than s2 or no comparison could be made |
0 | s1 is equal to s2 |
<0 | s1 is less than s2 |
Definition at line 56 of file strncmp.c.
References memcmp(), and strlen().
Referenced by strstr().