当前位置: 答题翼 > 问答 > 求职面试 > 正文
目录: 标题| 题干| 答案| 搜索| 相关
问题

void setmemory(char **p, int num) { *p=(char *) malloc(num);} void test(void) { ch


void setmemory(char **p, int num)

{ *p=(char *) malloc(num);}

void test(void)

{ char *str=NULL;

getmemory(&str,100);

strcpy(str,"hello");

printf(str);

}

运行test函数有什么结果?()

请帮忙给出正确答案和分析,谢谢!

参考答案
答案整理中……
您可能感兴趣的试题
  • void setmemory(char **p, int num) { *p=(char *) malloc(num);} void test(void) { ch

  • void setmemory(char **p, int num) { *p=(char *) malloc(num);}

  • void setmemory(char **p, int num) { *p=(char *) malloc(num);}

  • Void GetMemory2(char **p, int num){*p = (char *)malloc(num);}void Test(void){char *str

  • Void GetMemory2(char **p, int num){*p = (char *)malloc(num);}void Test(void){char *str

  • 若有结构体定义: struct stu {int num; char sex; int age; }a1,a2; 则下列语句中错误的是()。A.p