#include <string.h>
char *strdup(const char *s);
char *strndup(const char *s, size_t n);
#include <stdio.h>
#include <string.h>
int main(void)
{
char *s = "hello world";
char *p;
p = strdup (s);
printf ("%s\n", p);
return (0);
}
./strdup
hello world
欢迎光临 曲径通幽论坛 (http://www.groad.net/bbs/) | Powered by Discuz! X3.2 |