单项选择题

下面程序段的运行结果是( )。
char *p=" 123defgh";
p+=3;
printf("%d\n", strlen(strcpy(p, " ABCD") ) );

A) 8
B) 12
C) 4
D) 7
<上一题 目录 下一题>
热门 试题

单项选择题
阅读下列程序,当运行函数时,输入asd af aa z67,则输出为( )。 #include <stdio.h> #include <ctype.h> #include <string.h> int fun (char *str) inti, j=0; for(i=0; str[i]!=' 0'; i++) if(str[i]!=' ') str[j++]=str[i]; str[j]=' 0'; main() char str[81]; int n; printf( Input a string: ); gets(str); puts(str); fun(str); printf( %s n , str);
A) asdafaaz67
B) asd af aa z67
C) asd
D) z67
单项选择题
对下述程序的判断中,正确的是( )。 #include<stdio.h> void main() char*p, s[128]; p=s; while(strcmp(s, End ) ) printf( Input a string: ); gets(s); p=s; while(*p) putchar(*p++);
A) 此程序循环接收字符串并输出,直到接收字符串“End”为止
B) 此程序循环接收字符串,接收到字符串“End”则输出,否则程序终止
C) 此程序循环接收字符串并输出,直到接收字符串“End”为止,但因代码有错误,程序不能正常工作
D) 此程序循环接收字符串并将其连接在一起,直到接收字符串“End”为止,输出连接在一起的字符串
相关试题
  • p或(p)
  • k
  • 函数fun的功能是:将s所指字符串中下标为偶...
  • j
  • 给定程序中函数fun的功能是:首先把b所指字...