strdup 字符串复制 free
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <malloc.h>
int main()
{
char *s = "golden gold view";
char *d;
d = strdup(s);
if(NULL != d)
{
printf("%s\n",d);
free(d);
}
return 0;
}
~
浙公网安备 33010602011771号