strcat man page on NetBSD

Man page or keyword search:  
man Server   9087 pages
apropos Keyword Search (all sections)
Output format
NetBSD logo
[printable version]

STRCAT(3)		 BSD Library Functions Manual		     STRCAT(3)

NAME
     strcat, strncat — concatenate strings

LIBRARY
     Standard C Library (libc, -lc)

SYNOPSIS
     #include <string.h>

     char *
     strcat(char * restrict s, const char * restrict append);

     char *
     strncat(char * restrict s, const char * restrict append, size_t count);

DESCRIPTION
     The strcat() and strncat() functions append a copy of the nul-terminated
     string append to the end of the nul-terminated string s, then add a ter‐
     minating ‘\0’.  The string s must have sufficient space to hold the
     result.

     The strncat() function appends not more than count characters where space
     for the terminating ‘\0’ should not be included in count.

RETURN VALUES
     The strcat() and strncat() functions return the pointer s.

EXAMPLES
     The following appends “abc” to “chararray”:

	   char *letters = "abcdefghi";

	   (void)strncat(chararray, letters, 3);

     The following example shows how to use strncat() safely in conjunction
     with strncpy(3).

	   char buf[BUFSIZ];
	   char *input, *suffix;

	   (void)strncpy(buf, input, sizeof(buf) - 1);
	   buf[sizeof(buf) - 1] = '\0';
	   (void)strncat(buf, suffix, sizeof(buf) - 1 - strlen(buf));

     The above will copy as many characters from “input” to “buf” as will fit.
     It then appends as many characters from suffix as will fit (or none if
     there is no space).  For operations like this, the strlcpy(3) and
     strlcat(3) functions are a better choice, as shown below.

	   (void)strlcpy(buf, input, sizeof(buf));
	   (void)strlcat(buf, suffix, sizeof(buf));

SEE ALSO
     bcopy(3), memccpy(3), memcpy(3), memmove(3), strcpy(3), strlcat(3),
     strlcpy(3)

STANDARDS
     The strcat() and strncat() functions conform to ISO/IEC 9899:1999
     (“ISO C99”).

BSD				August 11, 2002				   BSD
[top]
                             _         _         _ 
                            | |       | |       | |     
                            | |       | |       | |     
                         __ | | __ __ | | __ __ | | __  
                         \ \| |/ / \ \| |/ / \ \| |/ /  
                          \ \ / /   \ \ / /   \ \ / /   
                           \   /     \   /     \   /    
                            \_/       \_/       \_/ 
More information is available in HTML format for server NetBSD

List of man pages available for NetBSD

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net