题目内容

If there is a definition: int *p[3];, the correct one in the following description is ( )

A pointer variable p with a base type of int is defined, which has three pointers
B. A pointer array p is defined, which contains three elements, each of which is a pointer with the base type of int
C. An integer array named *p is defined, which contains three elements of type int
D. A pointer variable p which point to one-dimensional array is defined. The one-dimensional array should have three elements of type int

查看答案
更多问题

#includevoid fun(int *a,int *b) { int *c; c=a;a=b;b=c; } main() { int x=3,y=5,*p=&x,*q=&y; fun(p,q); printf("%d,%d,",*p,*q); fun(&x,&y); printf("%d,%d\n",*p,*q); } The output of the program is ( ).

A. 3,5,5,3
B. 3,5,3,5
C. 5,3,3,5
D. 5,3,5,3

In C language function, array name cannot be a formal parameter.

Function call can be used as an actual parameter of a function.

#includef(int b[], int n) { int i, r; r=1; for(i=0; i<=n; i++) r=r*b[i]; return r; } main() { int x, a[]={ 2,3,4,5,6,7,8,9}; x=f(a, 3); printf("%d\n",x); } The output of the above program is ( ).

A. 720
B. 120
C. 24
D. 6

答案查题题库