current position:Home>I can't run the program that adds other people's strings

I can't run the program that adds other people's strings

2022-08-06 10:02:48CSDN Q&A

I can't run the program that adds other people's strings
#include

int main(void)
{
char* str1 = "Hello"; //(1)
char* str2 = "my";
char* str3 = "program1";
char* temp; // used to store the final generated string

temp = (char*)malloc(sizeof(char) * 50); //Apply for memory space, the size of the application here is 50 characters (char) (2)strcpy(temp, telNum); //(3)strcat(temp, telId);strcat(temp, send_data);printf(temp);free(temp); //(4) Release memoryreturn 0;

}

img

copyright notice
author[CSDN Q&A],Please bring the original link to reprint, thank you.
https://en.primo.wiki/2022/218/202207301843515303.html

Random recommended