strcat ( destination, source );
definition
char * strcat ( char * destination, const char * source );
function
复制source字符串添加到destination中。目标字符串中的终止空字符( ‘\0’ )被source的第一个字符覆盖,并且在destination中两者连接形成的新字符串的末尾包含一个空字符。
Parameters
destination
Pointer to the destination array, which should contain a C string, and be large enough to contain the concatenated resulting string.
指向destination数组的指针,它应该包含一个 C 字符串,并且足够大以包含连接的结果字符串。
source
C string to be appended. This should not overlap destination.
要附添加的 C 字符串。这不应该与destination重叠。
Example
code
#include <stdio.h>
#include <string.h>
int main ()
{
char str[80];
strcpy (str,"these ");
strcat (str,"strings ");
strcat (str,"are ");
strcat (str,"concatenated.");
puts (str);
return 0;
}
Output:
these strings are concatenated.
汉化
Parameters 参数
destination array 目标数组
the content 内容
concatenated 连接
be appended 被添加
overlap 重叠