41

单选题 41 /101

运行下面这段代码,会出现的情况是:()
void GetMemory(char *p) { p = (char *)malloc(100); }

void Test(void) {
    char *str = NULL;
    GetMemory(str);
    strcpy(str, "hello world");
    printf(str);
}


参考答案

hello world
显示为乱码
程序崩溃
hello