|
|
#include <string.h>char *strcat(char *str1, const char *str2);
The strcat( ) function concatenates a copy of str2 to str1 and terminates str1 with a null. The null terminator originally ending str1 is overwritten by the first character of str2. The string str2 is untouched by the operation. If the arrays overlap, the behavior of strcat( ) is undefined.
In C99, str1 and str2 are qualified by restrict.
The strcat( ) function returns str1.
Remember, no bounds checking takes place, so it is the programmer’s responsibility to ensure that str1 is large enough to hold both its original contents and also those of str2.
Related functions are strchr( ), strcmp( ), and strcpy( ).
|
|