icon Top 9 categories map      RocketAware > man pages >


Tips: Browse or Search all pages for efficient awareness of more than 6000 of the most popular reusable and open source applications, functions, libraries, and FAQs.

The "RKT couplings" below include links to source code, updates, additional information, advice, FAQs, and overviews.


Search all pages


By activity
Professions, Sciences, Humanities, Business, ...

User Interface
Text-based, GUI, Audio, Video, Keyboards, Mouse, Images,...

Text Strings
Conversions, tests, processing, manipulation,...

Integer, Floating point, Matrix, Statistics, Boolean, ...

Algorithms, Memory, Process control, Debugging, ...

Stored Data
Data storage, Integrity, Encryption, Compression, ...

Networks, protocols, Interprocess, Remote, Client Server, ...

Hard World
Timing, Calendar and Clock, Audio, Video, Printer, Controls...

File System
Management, Filtering, File & Directory access, Viewers, ...


RocketLink!--> Man page versions: OpenBSD FreeBSD RedHat Others

[ANSI C X3.159-1989]

STRCAT(3)                 OpenBSD Programmer's Manual                STRCAT(3)

     strcat, strncat - concatenate strings

     #include <string.h>

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

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

     The strcat() and strncat() functions append a copy of the null-terminated
     string append to the end of the null-terminated string s, then add a ter-
     minating `\0'. The string s must have sufficient space to hold the re-

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

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

     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));

     bcopy(3),  memccpy(3),  memcpy(3),  memmove(3),  strcpy(3),  strlcat(3),

     The strcat() and strncat() functions conform to ANSI X3.159-1989 (``ANSI

OpenBSD 2.6                      July 8, 1997                                1

Source: OpenBSD 2.6 man pages. Copyright: Portions are copyrighted by BERKELEY
SOFTWARE DESIGN, INC., The Regents of the University of California, Massachusetts
Institute of Technology, Free Software Foundation, FreeBSD Inc., and others.

(Corrections, notes, and links courtesy of RocketAware.com)

[Detailed Topics]
FreeBSD Sources for strcat(3) functions
OpenBSD sources for strcat(3)

[Overview Topics]

Up to: NUL Terminated String processing - NUL terminated string operations (strcpy, strlen, etc)

RocketLink!--> Man page versions: OpenBSD FreeBSD RedHat Others

[ANSI C X3.159-1989]

Rapid-Links: Search | About | Comments | Submit Path: RocketAware > man pages > strcat.3/
RocketAware.com is a service of Mib Software
Copyright 1999, Forrest J. Cavalier III. All Rights Reserved.
We welcome submissions and comments