下列与char*pa[3][5]={"a","bb","ccc"}等价的是()。
A.char (*pa)[][5]={"a","bb","ccc"}
B.char*pa[3][]={"a","bb","ccc"}
C.char pa[3][]={"a","bb","ccc"}
D.都不等价
A.char (*pa)[][5]={"a","bb","ccc"}
B.char*pa[3][]={"a","bb","ccc"}
C.char pa[3][]={"a","bb","ccc"}
D.都不等价
对两个数组a和b进行下列初始化: char m[]="1234567"; char n[]={'1','2','3','4','5','6','7'}; 则下列叙述正确的是()。
A.数组m与数组n完全相同
B.数组m与数组n长度相同
C.数组m比数组n长1
D.数组m与数组n中都存放字符串
对两个数组a和b进行下列初始化:
char m[]1="l234567":
char n[]={'1','2 ','3','4 ','5','6','7');
则下列叙述正确的是()。
A.数组m与数组n完全相同
B.数组m与数组n长度相同
C.数组m比数组n长1
D.数组m与数组n中都存放字符串
A.hello
B.the
C.world
D.hellotheworld
A.hello
B.the
C.world
D.hellotheworld
下列程序的输出结果为
#include
void main()
{
char,a[]={”hello",”the",”world”};
char**pa=a:
pa++;
cout<<*pa<
}
A.hello
B.the
C.world
D.hellotheworld
下列程序的输出结果为()。 #include (iostream) using namespace std; void main() char,a[ ] = { "hello" ," the" ," world" }; char * * pa = a: pa + +; cout << * pa << ENDL; }
A.hello
B.the
C.world
D.hellotheworld
下列语句段中,正确的是()。
A.street { int x; float y; int a[2]; unsigned b[3]; char name[ 10]; };
B.struct stu { unsigned a[3]; unsigned b[4]; }x; int *p=& x.a;
C.stmct stu { int a; float x[4]; }y={1,1.0}; float data=y.x;
D.struct nd { int a,b; unsigned c[2]=5; };
阅读下列函数说明和C函数,将应填入(n)处的字句写在对应栏内。
[函数2.1说明]
Fibonacci数列中头两个数均为1,从第三个数开始,每个数等于前两个数之和。下述程序计算Fibonacci数列中前15个数,并以每行5个数的格式输出。
[函数2.1]
include <stdio.h>
main()
{ int i,f,f1=1,f2=1;
printf("%5d%5d",f1,f2);
for(i=3;i<=15;i++){
f=(1);
printf("%5d",f);
if((2)= =0) printf("\n");
f1=12;
(3);
}
}
[函数2.2说明]
函数fun(char *str1,char *str2)的功能是将字符串str2拼接到str1之后。
[函数2.2]
fun(char *str1,char *str2)
{ int i,j;
for(i=0;str1[i]!='\0';i++);
for(j=0;str2[j]!='\0';j++) (4);
(5);
}