| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 545 人关注过本帖
标题:请教一下出什么错了
取消只看楼主 加入收藏
东风恶
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
快速回复:请教一下出什么错了
数据加载中...
 
   



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

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