返回主页
学习人数: 5.8k
stroke-dashoffset="28*2.6389" stroke-linecap="round" transform="rotate(-90 50 50)"/>
正确率: 28%
未通过

在VC6.0中,运行下面程序的输出结果是()

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

void MallocMem(char* pc) {
    pc = (char*) malloc (100);
    return;
}

int main() {
    char *str=NULL;
    MallocMem(str);
    strcpy(str,"hello ");
    strcat(str+2, "world");
    printf("%s",str);
    return 0;
}

A. hello world

B. 程序编译错误

C. 程序运行时崩溃

D. 其他几项都不对

上面问题的答案是:
A A 选项
B B 选项
C C 选项
D D 选项
回答区域
提示
提示内容

登录后提交答案


3 个回答 (点击展开回答)