指针问题,,不能够输出正确的结果
#include
#include
void getmemory(char **p)
{
*p=(char *)malloc(100);
strcpy(*p,"hello world");
}
int main( )
{
char **str=NULL;
getmemory(str);
printf("%s/n",*str);
free(str);
return 0;
}
不能输出正确的结果是为什么
KrisRoofe
2015/05/29 02:42- 指针
- 点赞
- 收藏
- 回答
满意答案