下面关于函数指针的使用,不正确的是?int a=1,b=2,c=3; int max(int a, int b){ //代码详情略 ... //返回最大值 return max_num; } int (*p) (int, int);
A: int max_ab = *p(a,b);
int max_abc = *p(max_ab,c);
B: int max_ab = p(&a,&b);
int max_abc = p(&max_ab,&c);
C: int max_ab = p(a,b);
int max_abc = p(max_ab,c);
D: int max_ab = p(*a,*b);
int max_abc = p(*max_ab,*c);
A: int max_ab = *p(a,b);
int max_abc = *p(max_ab,c);
B: int max_ab = p(&a,&b);
int max_abc = p(&max_ab,&c);
C: int max_ab = p(a,b);
int max_abc = p(max_ab,c);
D: int max_ab = p(*a,*b);
int max_abc = p(*max_ab,*c);
举一反三
- 下面关于函数指针的使用,不正确的是?int a=1,b=2,c=3; int max(int a, int b){ //代码详情略 ... //返回最大值 return max_num; } int (*p) (int, int); A: int max_ab = *p(a,b); int max_abc = *p(max_ab,c); B: int max_ab = p(&a,&b); int max_abc = p(&max_ab,&c); C: int max_ab = p(a,b); int max_abc = p(max_ab,c); D: int max_ab = p(*a,*b); int max_abc = p(*max_ab,*c);
- 如有int (*p)(int,int); int max(int,int); 则p=max(a,b); 正确
- 执行以下程序,如果输入为23 48 32,则输出结果为。#include<;stdio.h>;int max(int a,int b,int c);int main(){int a,b,c;scanf("%d%d%d",&a,&b,&c);printf("%d\n",max(a,b,c));return 0;}int max(int a,int b,int c){int max;max=a>;b?a:b;if(c>;max)max=c;return max;}
- 以下对一维数组的定义中,正确的是:( )。 A: B: define MAX 5int a[MAX]; C: int MAX=5;int a[MAX]; D: int MAX; Scanf(“%d”,&MAX);int a[MAX]; E: F: define MAX 5;int a[MAX];
- 以下对一维数组的定义中,正确的是________。 A: B: define MAX 5int a[MAX]; C: int MAX=5;int a[MAX]; D: E: define MAX 5;int a[MAX]; F: int MAX;Scanf("%d",&MAX); int a[MAX];