qfedu-c-level/day11/d9.c

18 lines
293 B
C
Raw Normal View History

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
char *p = (char *)malloc(32);
if (NULL == p)
{
perror("malloc");
return 1;
}
// strcpy 用于字符串拷贝
strcpy(p, "disen");
printf("%s\n", p);
free(p);
return 0;
}