设有以下语句: char str[4][12]={"aaa","bbbb","ccccc","dddddd"},*strp[4]; int i; for(i=0;i<4;i++) strp[i]=str[i]; 下列选项不是对字符正确引用的是(其中0≤k<4)( )。
A.strp
B.str[k][k]
C.* strp[k]
D.** strp
第1题:
【单选题】设有以下程序段: char str[4][10]={“frist”,”second”,”third”,”forurth”},*strp[4]; int n; for(n=0;n<4;n++) strp[n]=str[n]; 若k为int型变量且0<=k<4,则对字符串的不正确引用是()。
A.strp
B.str[k]
C.strp[k]
D.*strp
第2题:
设有以下语句,若0<k<4,下列选项中不能对数组中字符串的正确引用的是()。 char str[4][12]={"aaa","bbb","ccc","ddd"},*strp[4]; int j; for(j=0;j<4;j++) strp[j]=str[j];
A.*strp
B.strp
C.strp[k]
D.str[k]
第3题:
【单选题】设有以下定义语句,则引用正确(可以得到有效字符或字符串)的是()。 char strp[4][12]={"aaa","bbbb","ccccc","dddddd"};
A.strp[0][3]
B.strp[2]
C.strp[4]
D.strp[1][4]
第4题:
设有以下语句,若0<k<4,下列选项中不能对数组中字符串的正确引用的是()。 char str[4][12]={"aaa","bbb","ccc","ddd"},*strp[4]; int j; for(j=0;j<4;j++) strp[j]=str[j];
A.strp
B.*strp
C.strp[k]
D.str[k]
第5题:
下列程序的输出结果是 #include void main( ) { char * str="12123434"; int x1=0,x2=0,x3=0,x4=0,i; for(i=0;str[i]!='\0';i++) switch(str[i]) { case'1':x4++; case'2':x3++; case'3':x2++; case'4':x1++; } cout < < x1 < < "," < < x2
A.8,6,4,1
B.8,6,3,2
C.8,8,4,1
D.8,6,4,2
第6题:
下列程序的输出结果是 #include<iostream.h> void main() {char*str="12123434"; int x1=0,x2=0,x3=0,x4=0,i; for(i=0;str[i]!='\0';i++) switch(str[i]) {case'1':x4++; case'2':X3++; case'3':X2++; case'4':X1++; } cout<<X1<<","<
A.8,6,4,1
B.8,6,3,2
C.8,8,4,1
D.8,6,4,2
第7题:
以下程序的输出结果是______。 fun(int *s,int *p) { static int t=3; *p=s[t]; t--; } main() { int str[]={1,2,3,4},i,m=0; for(i=0;i<4;i++) {fun(str,&m); printf("%d",m); } printf("\n"); }
A.0
B.444412
C.1234
D.4321
第8题:
下列程序的输出结果是( )。#include<iostream.h>
voidmain()
(char*str="12123434";
intx1=0,x2=0,x3=0,x4=0,i;
for(i=0;str[i]!='\0';i++)
switch(str[i])
{case'1':x4++;
case'2':x3++;
case'3':x2++;
case'4':x1++;
}
cout<<x1<<","<<x2<:<","<<x3<
<","<<x4;
}
A.8,6,4,1
B.8,6,3,2
C.8,8,4,1
D.8,6.4,2
第9题:
下列程序的输出结果是( )。 #include<iostream.h> void main() {char*str=”12123434”; int x1=0,x2=0,x3=0,x4=0,i; for(i=0;str[i]!=’\0’;i++) switch(str[i]) {case’1’:x4++; case’2’:x3++; case’3’:x2++; case’4’:xl++; ) cout<<xl<<“,”<<x2<<
A.8,6,4,1
B.8,6,3,2
C.8,8,4,l
D.8,6,4,2