标题:请教一下出什么错了
取消只看楼主
东风恶
Rank: 1
等 级:新手上路
帖 子:14
专家分:8
注 册:2013-4-20
结帖率:100%
已结贴  问题点数:19 回复次数:1 
请教一下出什么错了
#include<stdio.h>
int main()
{
    int max(int,int);
    int min(int,int);
    int (*p)(int,int);
    int a,b,c,d;
    printf("enter two numbers");
    scanf("%d,%d",&a,&b);
    printf("\n1:max,2:min\n");
    scanf("%d",&c);
    if (c==1)
        p=max;
    else if(c==2)
        p=min;
    d=(*P)(a,b);
    printf("\n%d",d);

    return 0;

}

int max(int a,int b)
{
    if(a>=b)
        return(a);
    else
        return(b);
}


int min(int a,int b)
{
    if(a<=b)
        return (a);
    else return(b);
}

编译出错error C2065: 'P' : undeclared identifier
 error C2100: illegal indirection
 error C2064: term does not evaluate to a function


搜索更多相关主题的帖子: return numbers include 
2013-06-26 08:43
东风恶
Rank: 1
等 级:新手上路
帖 子:14
专家分:8
注 册:2013-4-20
得分:0 
回复 2楼 我叫沃恩
好的,谢谢
2013-06-26 21:41



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-416082-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.088557 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved