The correct statement group in the following options is ( ).
A. char s[8]; s={"Beijing"};
B. char *s; s={"Beijing"};
C. char s[8]; s="Beijing";
D. char *s; s="Beijing";
查看答案
main() { char A[20]="abcd"; printf("%d,%d\n",strlen(A),sizeof(A)); } The output of the program is ( ).
A. 20,4
B. 4,10
C. 20,20
D. 4,20
The correct initialization statement of one-dimensional array a is ( )
A. int a[10]=(0,0,0,0,0);
B. int a[10]={};
C. int a[]={0};
D. int a[10]={10*1};
If there are defined statements: int m[]={5,4,3,2,1},i=4;, the wrong reference to the element of array m is ( )
A. m[--i]
B. m[2*2]
C. m[m[0]]
D. m[m[i]]
The input function that should be used when the user asks for a space in the input string is ( )
A. scanf()
B. getchar()
C. gets()
D. getc()