*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->Tru64 Unix man pages -> strncat (3)              
Title
Content
Arch
Section
 

strncat(3)

Contents


NAME    [Toc]    [Back]

       strncat, strncmp, strncpy - Perform operations on string

SYNOPSIS    [Toc]    [Back]

       #include <string.h>

       char *strncat(
               char *s1,
               const char *s2,
               size_t n ); int strncmp(
               const char *s1,
               const char *s2,
               size_t n ); char *strncpy(
               char *s1,
               const char *s2,
               size_t n );

LIBRARY    [Toc]    [Back]

       Standard C Library (libc)

STANDARDS    [Toc]    [Back]

       Interfaces  documented  on  this reference page conform to
       industry standards as follows:

       strncat(), strncmp(), strncpy():  XSH4.2

       Refer to the standards(5) reference page for more information
 about industry standards and associated tags.

PARAMETERS    [Toc]    [Back]

       Points to a location containing the first string or array.
       Points to a location containing the second array.   Specifies
  the  number  of bytes. In strncat(), n specifies the
       maximum number of bytes to append; in strncmp(), n  specifies
  the  maximum  number  of  bytes  to  compare; and in
       strncpy(), n specifies the number of bytes to copy.

DESCRIPTION    [Toc]    [Back]

       The strncat() function appends no more than n  bytes  from
       the array pointed to by the s2 parameter to the end of the
       array pointed to by the s1 parameter. The initial byte  of
       the array pointed to by s2 overwrites the null byte at the
       end of a string pointed to by s1. It then appends  a  null
       byte  to  the  result,  and  returns s1. When operating on
       overlapping objects, the  behavior  of  this  function  is
       unreliable.

       The  strncmp()  function  compares  the  string  or  array
       pointed to by the s1 parameter to the array pointed to  by
       the  s2 parameter. The sign of a nonzero value returned by
       strcmp() is determined  by  the  sign  of  the  difference
       between the values of the first pair of bytes (both interpreted
 as unsigned char) that differ in the  two  compared
       objects.  The  strncmp() functions compares bytes until it
       has compared n bytes or until  it  reaches  a  terminating
       null byte.

       The  strncmp()  function  compares  objects  based  on the
       machine collating order. It does not use the locale-dependent
  sorting  order. Use the strcoll() or wcscoll() functions
 for locale-dependent sorting.

       The strncpy() function copies no more than  n  bytes  from
       the  array  pointed  to  by  the s2 parameter to the array
       pointed to by the s1 parameter.  Bytes  following  a  null
       byte  are  not copied. When operating on overlapping locations,
 the behavior of this function is  unreliable.  When
       the  location  pointed  to by the s2 parameter is an array
       that is shorter than n bytes, null bytes are  appended  to
       the s1 value until n bytes in all are written.

RETURN VALUES    [Toc]    [Back]

       Upon  successful  completion,  the strncat() and strncpy()
       functions return a pointer  to  the  resulting  string  or
       array.  [Tru64  UNIX]  Otherwise, these functions return a
       null pointer.

       Upon successful completion, the strncmp() function returns
       an  integer whose value is greater than, equal to, or less
       than 0 (zero), according to whether the value  of  the  s1
       object  is  greater than, equal to, or less than the value
       of the s2 object. [Tru64 UNIX]  When a successful comparison
 cannot be made, strncmp() returns a value of 0 (zero).

SEE ALSO    [Toc]    [Back]

      
      
       Functions: string(3), strcasecmp(3), strcat(3), strcmp(3),
       strcoll(3), strcpy(3), wcscoll(3), wcsncat(3), wcsncmp(3),
       wcsncpy(3)

       Standards: standards(5)



                                                       strncat(3)
[ Back ]
 Similar pages
Name OS Title
memcpy Tru64 Perform memory operations
opendir Tru64 Perform operations on directories
bzero Tru64 Perform memory operations
readdir Tru64 Perform operations on directories
bcmp Tru64 Perform memory operations
strcpy Tru64 Perform operations on strings
rewinddir Tru64 Perform operations on directories
seekdir Tru64 Perform operations on directories
closedir Tru64 Perform operations on directories
string Tru64 Perform operations on strings
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service