#include <stdio.h>
#include <string.h>
char*
copy_string(char *string)
{
//static char tmp[20];
static char *temp;
memcpy(&temp,&string,10);
//memcpy(temp,string,10);
//memcpy(*temp,*string,10);
return temp;
}
int
main()
{
char *show,*result;
show="haha show";
result="test";
printf("show point to address : %p\n",show);
printf("result point to address : %p\n",result);
result = copy_string(show);
printf("***result string : %s\n",result);
printf("show point to address : %p\n",show);
printf("result point to address : %p\n",result);
return 0;
}