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;
}