[主观题]

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 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 函数会有什么样的结果?

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

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

  • 查看答案
  • 有以下程序 #include void f(char p[][10],int n

    [单选题]有以下程序 include void f(char p[][10],int n)£¯*字符串从小到大排序*£¯ {有以下程序 #include<string.h> void f(char p[][10],int n)/*字符串从小到大排序*/ { char t[10];int i,j; for(i=0;i<n-1;i++) for(j=i+1;j<n;j++) if(strcmp(p[i],p[j])>0) {strcpy(t,p[i]);strcpy(p[i],p[j]);strcpy(p[j

  • 查看答案
  • 有以下程序 #include void f(char p[][10],int n

    [单选题]有以下程序 include void f(char p[][10],int n)£¯*字符串从小到大排序*£¯ {有以下程序 #include<string.h> void f(char p[][10],int n)/*字符串从小到大排序*/ { char t[10];int i,j; for(i=0;i<n-1;i++) for(j=i+1;j<n;j++) if(strcmp(p[i],p[j])>0) {strcpy(t,p[i]);strcpy(p[i],p[j]);strcpy(p[j

  • 查看答案
  • 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 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=(