网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)
有以下程序includemain(){char p[]={'a','b','c'},q[10]={'a','b','c'}; printf("%d%

有以下程序 #include<string.h> main() { char p[]={'a','b','c'},q[10]={'a','b','c'}; printf("%d%d\n",strlen(p),strlen(q));} 以下叙述中正确的是

A.在给p和q数组置初值时,系统会自动添加字符串结束符,故输出的长度都为3

B.由于p数组中没有字符串结束符,长度不能确定,但q数组中字符串长度为3

C.由于q数组中没有字符串结束符,长度不能确定,但p数组中字符串长度为3

D.由于p和q数组中都没有字符串结束符,故长度都不能确定


参考答案

更多 “ 有以下程序includemain(){char p[]={'a','b','c'},q[10]={'a','b','c'}; printf("%d% 有以下程序 #include<string.h> main() { char p[]={'a','b','c'},q[10]={'a','b','c'}; printf("%d%d\n",strlen(p),strlen(q));} 以下叙述中正确的是A.在给p和q数组置初值时,系统会自动添加字符串结束符,故输出的长度都为3B.由于p数组中没有字符串结束符,长度不能确定,但q数组中字符串长度为3C.由于q数组中没有字符串结束符,长度不能确定,但p数组中字符串长度为3D.由于p和q数组中都没有字符串结束符,故长度都不能确定 ” 相关考题
考题 有以下程序includemain(){char *p=“abcde、Ofghjik\0”;printf(“%d\n”,strlen(p));} 程 有以下程序 #include<string.h> main() { char *p=“abcde、Ofghjik\0”; printf(“%d\n”,strlen(p)); } 程序运行后的输出结果A.12B.15C.6D.5

考题 有以下程序includemain(){ char*p,*q;p=(char *)malloc(sizeof(char)*20);q=p;scanf( 有以下程序 #include<stdlib.h> main() { char*p,*q; p=(char *)malloc(sizeof(char)*20);q=p; scanf(“%s%s”,p,q);printf(“%s%s\n”,p,q); } 若从键盘输入:abc def<回车>,则输出结果是A.def defB.abc defC.abc dD.d d

考题 有以下程序include main(){ char *p,*q;p=(char*)malloc(sizeof(char)*20);q=p;scanf 有以下程序 #include <stdlib.h> main() { char *p,*q; p=(char*)malloc(sizeof(char)*20); q=p; scanf("%s %s",p,q); printf("%s %s\n",p,q); } 若从键盘输入:abc def<回车>, 则输出结果是A.def defB.abc delC.abc dD.d d

考题 有以下程序:includemain(){char *p="abcde\Ofghjik\0";printf("%d\n",strlen(p));}程 有以下程序: #include <string.h> main() {char *p="abcde\Ofghjik\0"; printf("%d\n",strlen(p)); } 程序运行后的输出结果是( )。A.12B.15C.6D.5

考题 有以下程序:includemain(){char *p,*q; p=(char*)malloc(sizeof(char)*20);q=p; scan 有以下程序: #include <stdlib.h> main() { char *p,*q; p=(char*)malloc(sizeof(char)*20);q=p; scanf("%s%s",p,q); printf("%s%s\n",p,q); } 若从键盘输入:abc def<回车>,则输出结果是( )。A.def defB.abc defC.abe dD.d d

考题 有以下程序include.main(){char*p="abcde\ofghjik\0";printf("%d\n",strlen(p));} 程 有以下程序 #include.<string.h> main() { char *p="abcde\ofghjik\0"; printf("%d\n",strlen(p)); } 程序运行后的输出结果是A.12B.15C.6D.5

考题 有以下程序: include main( ) { char *p="abcde\0ghjik\0"; printf("%d\n",str 有以下程序: #include<string.h> main( ) { char *p="abcde\0ghjik\0"; printf("%d\n",strlen(p) ); } 程序运行后的输出结果是A.12B.15C.6D.5

考题 有以下程序: include main( ) { char *p ,* q; p=(char * )malloc(sizeof(char 有以下程序: #include<stdlib.h> main( ) { char *p ,* q; p=(char * )malloc(sizeof(char) * 20);q=p; scanf("%s%s",p,q); printf("%s%s\n",p,q); } 若从键盘输入:abc def<回车>,则输出结果是A.def defB.abc defC.abc dD.d d

考题 有以下程序:include include main(){char *p[10]={"abc","aabdfg","dcdbe" 有以下程序: #include <stdio.h> #include <string.h> main() { char *p[10]={"abc","aabdfg","dcdbe","abbd","cd"}; printf("%d\n",strlen(p[4])); } 执行后的输出结果是( )。A.2B.3C.4D.5

考题 21、以下程序执行后的结果为 。 #include "stdio.h" #include <string.h> void fun(char *s) { char a[10]; strcpy(a,"string"); s=a; } main() { char *p="gao"; fun(p); printf("%s\n",p); }A.gaoB.结果不确定C.strD.string