69,382
社区成员
发帖
与我相关
我的任务
分享
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
char* ptr = (char*)malloc(sizeof(char)*10);
strcpy(ptr, "hello");
printf("%s\n", ptr);
free(ptr);
strcpy(ptr, "world");
printf("%s\n", ptr);
return 0;
}