当前位置:才华君>好好学习>考研>

华为填空题

考研 阅读(1.13W)

1、在windows下,写出运行结果,每空2分,共10分。

华为填空题

charstr[]="Hello";

char*p=str;

intn=10;

sizeof(str)=()

sizeof(p)=()

sizeof(n)=()

voidfunc(charstr[100])

{}

sizeof(str)=()

2、voidsetmemory(char**p,intnum)

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

voidtest(void)

{char*str=NULL;

getmemory(&str,100);

strcpy(str,"hello");

printf(str);

}

运行

test函数有什么结果?()

10分

3、设

intarr[]={6,7,8,9,10};

int*ptr=arr;

(ptr++)+=123;

printf("%d,%d",*ptr,*(++ptr));

()10分