用strcpy连接字符串

pr1*_*m3x 3 c

这是我的代码

#include <stdio.h>
#include <string.h>
#include <stdlib.h>


int main() {

 char f[] = "First";
 char s[] = "Second";
 char *tmp = malloc(strlen(f) + strlen(s) + 2);
 strcpy(tmp, f);
 strcpy(tmp, s);
 printf("%s", tmp);
 free(tmp);
 return 0;
}
Run Code Online (Sandbox Code Playgroud)

我正在尝试连接f和s.问题是tmp只包含"Second"作为数组.我想念的是什么

Dan*_*her 6

strcpy您希望将字符串复制到目标的开头strcat.