strcat(3) CLIX strcat(3)
NAME
strcat - Appends copy of a string
LIBRARY
Standard C Library (libc.a)
SYNOPSIS
#include <string.h>
char *strcat(
char * string1 ,
char * string2 );
PARAMETERS
string1
A pointer to a character string.
string2
A pointer to a character string.
DESCRIPTION
The strcat() function appends a copy of the string pointed to by the
string2 parameter, including the terminating null character, to the end of
the string pointed to by the string1 parameter. The beginning character
of the string pointed to by the string2 parameter overwrites the null
character at the end of the string pointed to by the string1 parameter.
EXAMPLES
#include <string.h>
main()
{
char whole_string[20];
char *string1 = "hello ";
char *string2 = "world!"
/* copy "hello " into whole_string */
strcpy (whole_string, string1);
/* append "world!" on whole_string */
strcat (whole_string, string2);
}
CAUTIONS
2/94 - Intergraph Corporation 1
strcat(3) CLIX strcat(3)
When operating on overlapping strings, the behavior of this function is
unreliable.
RETURN VALUES
Upon successful completion, the strcat() function returns a pointer to the
resulting string. Otherwise, this function returns a null pointer.
RELATED INFORMATION
Functions: index(3), rindex(3), strchr(3), strcmp(3), strcspn(3),
strcpy(3), strlen(3), strncat(3), strncmp(3), strncpy(3), strpbrk(3),
strrchr(3), strspn(3)
2 Intergraph Corporation - 2/94