别人字符串相加的程序我无法运行
#include <string.h>
int main(void)
{
char* str1 = "Hello"; //(1)
char* str2 = "my";
char* str3 = "program1";
char* temp; //用于储存最终生成的字符串
temp = (char*)malloc(sizeof(char) * 50); //申请内存空间,此处申请大小为50个字符(char)的大小 (2)
strcpy(temp, telNum); //(3)
strcat(temp, telId);
strcat(temp, send_data);
printf(temp);
free(temp); //(4)释放内存
return 0;
}