下面关于函数指针的使用,不正确的是?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); 正确
- 函数首部定义为:int max(int a,int b)的函数,下列函数声明语句正确的是()。 A: int max(int,int); B: int max(int a,int b); C: int max(int b,int a); D: int max(int x,int y);
- 请将以下程序中的函数声明语句补充完整 int _________; main ( ){ int x, y, (*p)(); p=max; printf(“%d\n”, &x, &y ); } int max(int a, int b) { return (a>b/a:b); }
- 下列语句中,不正确的是 ( )。A)c=2*max(a,b); B)m=max(a,max(b,c));C)printf("%d",max(a,b)); D)int max(int x,int max(int y,int z))