18 lines
293 B
C
18 lines
293 B
C
|
#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;
|
||
|
}
|