A-A+

对下述程序的判断中 正确的是()。 #include main() { c

2022-08-06 03:21:20 问答库 阅读 175 次

问题详情

对下述程序的判断中,正确的是()。 #include<stdio.h> main() { char*p,s[256]; p=s ; while(strcmp(s,"the end")) { printf("Input the strin9:"); gets(s); while(*p) putchar(*p++); }}
A.此程序循环接收字符串并输出,直到接收到字符串“the end”为止
B.此程序循环接收字符串,接收到字符串“the end”则输出,否则程序终止
C.此程序循环接收字符串并输出,直到接收字符串“the end”为止,但因为代码有错误,程序不能正常工作
D.此程序循环接收字符串并将其连接在一起,直到接收字符串“the end”为止,输出连接在一起的字符串请帮忙给出正确答案和分析,谢谢!

参考答案

正确答案:C
外部变量在编译时由系统分配永久的内存空间,所以外部变量的类型不是自动存储类别。

考点:程序