64,649
社区成员
发帖
与我相关
我的任务
分享
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/*
在经历过无数的"烫烫烫烫烫","屯屯屯屯屯屯"之后,
我们都知道了,内存原来是可以驾驭的...
*/
int main()
{
/*
原来内存管理是这样的,即便结果完美无缺,
但却危机四伏........
*/
const char *src="Hello Csdn!";
char *dest=(char*) malloc(strlen(src));
memcpy(dest,src,strlen(src)+1);
printf("%s\n",dest);
return 0;
}
/*
今天的故事到这里...希望大家少一点屯...
*/