#include< stdio.h > #include< malloc.h > int main(void) { char *p; char a[]="FireRabbit"; p=malloc(sizeof(a)); //分配和数组a一样的空间 p="FireRabbit"; puts(p); free(p); //调用结束后将其释放 return 0; }