

strncmp()                String Function                strncmp()




Compare two strings

#include <string.h>
iinntt ssttrrnnccmmpp(_s_t_r_i_n_g_1, _s_t_r_i_n_g_2, _n)
cchhaarr *_s_t_r_i_n_g_1, *_s_t_r_i_n_g_2; uunnssiiggnneedd _n;

strncmp compares  lexicographically the first n  bytes of string1
with string2.   Comparison ends when n  bytes have been compared,
or a null character encountered, whichever occurs first.  strncmp
returns zero if the  strings are identical, returns a number less
than zero if  string1 occurs earlier alphabetically than string2,
and returns a number greater  than zero if it occurs later.  This
routine is compatible with the ordering routine needed by qsort.

***** Example *****

For an example of this function, see the entry for ssttrrnnccppyy.

***** See Also *****

strcmp(), string functions, string.h



































COHERENT Lexicon                                           Page 1


