scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

strncmp.3 (840B)


      1 .TH strncmp 3
      2 .SH NAME
      3 strncmp - compare part of two strings
      4 .SH SYNOPSIS
      5 #include <string.h>
      6 
      7 int strncmp(const char *s1, const char *s2, size_t n)
      8 .SH DESCRIPTION
      9 The
     10 .BR strncmp ()
     11 function compares not more than
     12 .I n
     13 characters
     14 (characters that follow a null character are not compared)
     15 from the array pointed to by
     16 .I s1
     17 to the array pointed to by
     18 .IR s2 .
     19 .PP
     20 The value returned shall be used to determine
     21 if a string is lexicographically
     22 greater than, lesser than or equal to
     23 the other string.
     24 .SH RETURN VALUE
     25 The
     26 .BR strncmp ()
     27 function shall return an integer greater than,
     28 equal to, or lesser than 0,
     29 if the string pointed to by
     30 .I s1
     31 is greater than,
     32 equal to, or lesser than the string pointed to by
     33 .IR s2 ,
     34 respectively.
     35 .PP
     36 The function shall return 0 if
     37 .I n
     38 is equal to 0.
     39 .SH STANDARDS
     40 ISO/IEC 9899:1999 Section 7.21.4.4