首页/ 题库 / [单选题]下面程序段的运行结果是 char *p=的答案

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

单选题
2022-11-24 00:02
A、8
B、12
C、4
D、7
查看答案

正确答案
C

试题解析
解析: 本题考查两个知识点:strlen函数的功能是求字符串的长度,并返回字符个数,不计最后的'\0',strcpy函数的功能是把后面的字符串复制到前面字符串所指向的空间。

标签:
相关题目
下面程序段的运行结果是
char*p="abcdefgh";
p+=3;
printf("%d\n",strlen(strcpy(p,"ABCD")));
有以下程序
#include
main()
{char*p="abcde\0fghjik\0";
printf("%d\n",strlen(p));
}
程序运行后的输出结果是
下面程序段的运行结果是 char a[ ]="language",*p ; p=a ; while (*p!=.u.) { cout
下面程序段的运行结果是( )。 char str[ ]="ABC", *p=str; p++; cout<<*p;
设有以下程序片段:char a[ ]=hello,p;p=a;printf(%d,(p+5));执行上面的程序片段后的结果为( )
下列程序段的执行结果是main(){char c1=’C’,c2=’Z’;printf(“%d,%d”,c1,c2);}
下面程序段运行结果是_____char p="%d,a=%d,b=%d\n";int a=111,b=10,c;c=a%b; p+=3;printf(p,c,a,b);
以下程序运行后,输出结果是()。main( ){int a[10]={19,23,44,17,37,28,49,36},p;p=a;printf("%d\n",(p+=3)[3]);}
有以下程序: #include<string.h> main() { char str[][20]={"Hello","Beijing"),*p=str[0]; printf("%d ",strlen(p+20)); } 程序运行后的输出结果是( )。
有以下程序: # include<string.h> main() { char str[][20]={"Hello","Beijing"},*p=str; printf("%d ",strlen(p+20)); } 程序运行后的输出结果是 ______。
有以下程序: mam() { char s[]="ABCD",*p; for( p=s+1;p<s+4;p++)printf("%s ",p); } 程序运行后的输出结果是( )。
有以下程序 main() { char s[]="ABCD", *p; for( p=s+1;p<s+4;p++) printf("%s ",p); } 程序运行后的输出结果是
下面程序的输出结果是_______。 #define P1(x)printf(x) main() { char d[]="p"; P1(d) ; P1("d"); }
下面程序段的运行结果是( )。 char*p=" %d,a=%d,b=%d "; int a=111,b=10,c; c=a%b; p+=3; printf(p,c,a,b);
有以下程序:point(char*p) { *p=’d’; }main(){ char b[4]={’a’,’b’,’c’,’d’},*p=b; Point(p); printf("%c\n",*p);}程序运行后的输出结果是( )。A.a B.b C.c D.d
以下程序段的输出结果是 char s[]="\141141abc "; printf ("%d ",strlen(s));
下面程序段的输出结果是( )。 char str[]="ABC",*p=str; Printf("%d ",*(p+3));
下面程序段的运行结果是 char str[]="ABC",*p=str; printf("%d ",*(p+3));
以下程序段的输出结果是 char s[]=“\141141abc ”; printf(“%d ”,strlen(s));
下面程序段的运行结果是char str[]="ABC",*p=str;printf("%d\n",*(p+3));
广告位招租WX:84302438

免费的网站请分享给朋友吧