有以下程序: include include main( ) {char p[] = {'a','b','c'] ,q[10 有以下程序: #include <stdio.h> #include <string.h> main( ) { char p[] = {'a','b','c'] ,q[10] = {'a','h','c'} prinff( "% d % d\n" , strlen (p) , strlen (q) );以下叙述中正确的是( )。A.在给p和q数组赋初值时,系统会自动添加字符串结束符,故输出的长度都为3B.由于P数组中没有字符串结束符,长度不能确定;q数组中字符串长度为3C.由于q数组中没有字符串结束符,长度不能确定;p数组中字符长度为3D.由于p和q数组中没有字符串结束符,故长度都不能确定

有以下程序: include include main( ) {char p[] = {'a','b','c'] ,q[10

有以下程序: #include <stdio.h> #include <string.h> main( ) { char p[] = {'a','b','c'] ,q[10] = {'a','h','c'} prinff( "% 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,*q; p=(char *)malloc(sizeof(char)* 20);q=p; sca 有以下程序: # include<stdio.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

有以下程序:includeincludeincludevoid f(char*s,char*t){char k;k=*s; * 有以下程序: #include<stdio.h> #include<string.h> #include void f(char*s,char*t) { char k; k=*s; *s=*t; *t=k; s++;t--; if(*s)f(s,t): } main() {char str[10]="abcdefg",*P; P=str+strlen(str)/2+1: f(p,p-2); printf("%s\n",str); } 程序运行后的输出结果是( )。A.abcdefgB.gfedcbaC.gbcdefaD.abedcfg

有如下程序段#include "stdio.h"#include "string.h"#define N 10#define M 10char *find(char(*a)[M],int n){ char *q;int i; q=a[0]; for(i=0;in;i++) if(strcmp(a[i],q)0)q=a[i]; return q;}main(){ char s[N][M]={"tomeetme","you","and","he","china"}; char *p; int n=5; p=find(s,n); puts(p);}则执行后输出的结果为A.he B.and C.you D.tomeetme

以下程序的输出结果是【 】。includeincludechar*fun(char*0{ char *p--t;retur 以下程序的输出结果是【 】。include <stdio.h>include <string.h>char *fun(char *0{ char *p--t;return (p+strlen(t)/2);}main(){ char *str="abcdefgh";str=ftm(str);puts(str);}

有以下程序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 include void f(char * s,char*t){char k; k=*s;*s=* 有以下程序: #include <stdio.h>#include <string.h>void f(char * s,char*t){ char k; k=*s; *s=*t; *t=k; s++; t--; if( * s) f(s,t);}main( ){ char str[10] :"abedefg", * p; p = str + strlen(str)/2+1; f(p,p -2); printf( "% s \n" ,str);程序运行后的输出结果是( )。A.abcdefgB.gfedcbaC.gbcdefaD.abedcfg

有以下程序: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

以下程序的输出结果是【 】。includeincludechar*fun(char*t){ char *p=t;retur 以下程序的输出结果是【 】。include <stdio.h>include <string.h>char *fun(char *t){ char *p=t;return (p+strlen(t)/2);}main(){ char *str="abcdefgh";str=ftm(str);puts(str);}

以下程序运行后的输出结果是() 。   #include <stdio.h>   #include <stdlib.h>   #include <string.h>   main()   { char *p; int i;    p=(char *)malloc(sizeof(char)*20);    strcpy(p,"welcome");    for(i=6;i>=0;i--) putchar(*(p+i));    printf("n"); free(p);   }

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