[主观题]

void GetMemory(char *p){p = (char *)malloc(100);}void Test(void) {char *str

= NULL;GetMemory(str); strcpy(str, "hello world");printf(str);}请问运行 Test 函数

会有什么样的结果?

参考答案与解析:

相关试题

char*getmemory(void) { char p[]=”hello w

[主观题]char*getmemory(void){ char p[]=”hello world”;return p;}void test(void){char *str=null;str=Getmemory();printf(str);} 请问运行 Test 函数会有什么样的结果.

  • 查看答案
  • char*getmemory(void) { char p[]=”hello w

    [主观题]char*getmemory(void){ char p[]=”hello world”;return p;}void test(void){char *str=null;str=Getmemory();printf(str);} 请问运行 Test 函数会有什么样的结果.

  • 查看答案
  • char *GetMemory(void){ char p[] = "hello

    [主观题]char *GetMemory(void){ char p[] = "hello world";returnp; }void Test(void){char *str = NULL;str = GetMemory(); printf(str);}请问运行 Test 函数会有什么样的结果?

  • 查看答案
  • char *GetMemory(void){ char p[] = "hello

    [主观题]char *GetMemory(void){ char p[] = "hello world";returnp; }void Test(void){char *str = NULL;str = GetMemory(); printf(str);}请问运行 Test 函数会有什么样的结果?

  • 查看答案
  • Void GetMemory2(char **p, int num){*p =

    [主观题]Void GetMemory2(char **p, int num){*p = (char *)malloc(num);}voidTest(void){char *str = NULL;GetMemory(&str, 100);strcpy(str, "hello"); printf(str); }请问运行Test 函数会有什么样的结果?

  • 查看答案
  • 有关内存的思考题 1. void getmemory(char *p) { p=

    [主观题]有关内存的思考题1. void getmemory(char *p){ p=(char*)mallol(100);}void test(void){char * str =null;getmemory(str);strcpy(str,”hello,world”);printf(str);}请问运行 Test 函数会有什么样的结果

  • 查看答案
  • 有以下程序:void funl(char*p){ char*q;q=P;whil

    [单选题]有以下程序:void funl(char*p){ char*q;q=P;while(*q!=\O){(*q)++;q++;}}main{ char a[]={"Program"),*P;p=&a[3];funl(p);printf("%s\n",a);}程序执行后的输出结果是( )。A.ProhsbnB.PrphsbnC.ProgsbnD.Program

  • 查看答案
  • 若有如下程序:void a(char*p,char c){while(*p){i

    [单选题]若有如下程序: void a(char*p,char c) {while(*p) { if(*p==c)*p=c-'b'+'B';; p++; } } main() {char s[50]="abcdeeffgee",b='e'; a(s,b);printf("%s/n",s); } 则程序运行后的输出结果是( )。A.AbcdeeffgeeB.ABCDeeFFGeeC.abcdEEffgEED.ABCDEEFFGEE

  • 查看答案
  • void setmemory(char **p, int num) { *p=(

    [主观题]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 fun1(char *p){ char *q;q=p;whi

    [单选题]有以下程序void fun1(char *p){ char *q;q=p;while(*q!='/0'){ (*q)++; q++; ) }}main(){ char a[]={"Program"),*p;p=&a[3];fun1(p);printf(" % s/n",a);}程序执行后的输出结果是A.)ProhsbnB.)PrphsbnC.)ProgsbnD.)Program

  • 查看答案
  • void GetMemory(char *p){p = (char *)mall