| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 464 人关注过本帖
标题:error executing是什么问题?
只看楼主 加入收藏
晓宁
Rank: 1
等 级:新手上路
帖 子:22
专家分:0
注 册:2011-9-7
结帖率:71.43%
收藏
 问题点数:0 回复次数:1 
error executing是什么问题?
#include<iostream>                       
#include<string>
using namespace std;

class Customer                                            
{
    friend void displayAsFriend(Customer);               
private:
    int custNum;
    double balanceDue;
public:
    Customer(int=0, double=0.0);
    void displayCustomer();
};
Customer :: Customer(int num,double balance)
{
    custNum=num;                                          
    balanceDue=balance;
}
void Customer :: displayCustomer()                  
{
    cout<<"In the member function"<<endl;
    cout<<"Customer #"<<custNum<<" has balance of RM"<<balanceDue<<endl;
}
void displayAsFriend(Customer cust)                             
{
    cout<<" In the friend function: "<<endl;
    cout<<" Customer #"<<cust.custNum<<" has a balance of RM "<<cust.balanceDue<<endl;
}

int main()
{
    Customer onePatron(3815,259.25);
    onePatron.displayCustomer();
    displayAsFriend(onePatron);
    return 0;        
}
搜索更多相关主题的帖子: double void private balance include 
2011-09-08 15:38
czsbc
Rank: 10Rank: 10Rank: 10
等 级:青峰侠
帖 子:469
专家分:1700
注 册:2008-12-13
收藏
得分:0 
using namespace std;        //这里的分号要改成英文分号。

2011-09-08 15:47
快速回复:error executing是什么问题?
数据加载中...
 
   



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

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