Index Index for
Section 9r
Index Alphabetical
listing for S
Bottom of page Bottom of
page

strncmp(9r)

NAME

strncmp - General: Compares two strings, using a specified number of characters

SYNOPSIS

int strncmp( char *s1, char *s2, int n );

ARGUMENTS

s1 Specifies a pointer to a string (an array of characters terminated by a null character). s2 Specifies a pointer to a string (an array of characters terminated by a null character). n Specifies the number of bytes to be compared.

DESCRIPTION

The strncmp routine compares string s1 to string s2, using the number of characters specified in n.

RETURN VALUES

If string s1 is equal to the null character ( \0 ), strncmp returns the value 0 (zero). Otherwise, it returns the difference between the number of characters in s1 and s2.

SEE ALSO

Routines: strcmp(9r)

Index Index for
Section 9r
Index Alphabetical
listing for S
Top of page Top of
page