| 编程中国 | 业界新闻 | 技术文章 | 视频教程 | 下载频道 | 程序源码 | 个人空间 | 编程论坛
全能ASP/PHP/ASP.NET主机,支持月付专业 MSSQL 数据库空间,支持月付专业 MySQL 数据库空间,支持月付赛孚耐:软件保护加密专家
身份认证令牌USB KEY   
共有 444 人关注过本帖
标题:这也错了?这么简单?晕
收藏  订阅  推荐  打印 
DG中专生
Rank: 2
等级:注册会员
帖子:52
积分:656
注册:2007-9-11
这也错了?这么简单?晕

#include<iostream>
#include<string>
using namespace std;
int main()
{
class a{
public:
bool b(const int c,const int d)
{
   return c>b?c:d;
}
}
bool g;
int e=10,f=11;
cout<<g.b(e,f)<<endl;
return 0;
}
搜索更多相关主题的帖子: int  bool  const  include  std  
2007-12-7 13:53
DG中专生
Rank: 2
等级:注册会员
帖子:52
积分:656
注册:2007-9-11

#include<iostream>
#include<string>
using namespace std;
int main()
{
    class a{
    public:
    int b(const int c,const int d)
    {
      return    c>b?c:d;
    }
    };
    int g;
    int e=10,f=11;
    cout<<g.b(e,f)<<endl;
    return 0;
}
改成这样了?错误还有,哪里?谢谢
2007-12-7 14:01
中学者
Rank: 12Rank: 12Rank: 12
等级:版主
威望:14
帖子:3389
积分:34733
注册:2007-9-14

原帖由 [bold][underline]DG中专生[/underline][/bold] 于 2007-12-7 14:01 发表 [url=http://bbs.bc-cn.net/redirect.php?goto=findpost&pid=1136101&ptid=190984][/url]
#include
#include
using namespace std;
int main()
{
     class a{
     public:
     int b(const int c,const int d)
     {
       return     c>b?c:d;
     }
     };
    int g;
     int e=10,f=11;
     cout<<g.b(e,f)<<endl;
红的地方改为:  c>d  和 a g;

汇编.....
2007-12-7 14:07
heyyroup
Rank: 2
等级:注册会员
帖子:77
积分:926
注册:2006-6-14

int g;
        int e=10,f=11;
        cout<<g.b(e,f)<<endl;
        return 0;
g要声明成类的对象才能调用类的成员函数
2007-12-7 14:07
关于我们 | 广告合作 | 编程中国 | 清除Cookies | Archiver | WAP | TOP

编程中国 版权所有,并保留所有权利。鲁ICP备08000592号
Powered by Discuz, Processed in 0.054707 second(s), 9 queries.
Copyright©2004-2008, BCCN.NET, All Rights Reserved