| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 363 人关注过本帖
标题:[求助]一个奇怪的错误!
只看楼主 加入收藏
ar7043
Rank: 1
等 级:新手上路
帖 子:15
专家分:0
注 册:2006-8-15
收藏
 问题点数:0 回复次数:1 
[求助]一个奇怪的错误!
#include<iostream>
using namespace std;

class Saving
{
int user_num;
double money;
double account;
public:
Saving(int un,double mony=0.0,double acct=0.0);
double save(double mony)
{
account+=mony;
return account;
}
virtual void withdraw(double acct,double mony)=0;
double show()
{
return account;
}
};
class Saving1:public Saving
{ double q;
public:
Saving1();
Saving1(int un,double mony=0.0,double acct=0.0);
void withdraw(double acct,double mony)
{
q=show();
if(mony!=q)
{cout<<"money must be withdraw by one time"<<endl;}
else cout<<"you can get"<<mony*(1+0.5)<<endl;
}
};
class Saving3:public Saving
{
double q;
public:
Saving3();
Saving3(int un,double mony=0.0,double acct=0.0);
void withdraw(double acct,double mony)
{
q=show();
if(mony!=q)
{cout<<"money must be withdraw by one time"<<endl;}
else cout<<"you can get"<<mony*(1+0.8)<<endl;
}
};
class Saving5:public Saving
{
double q;
public:
Saving5();
Saving5(int un,double mony=0.0,double acct=0.0);
void withdraw(double acct,double mony)
{
q=show();
if(mony!=q)
{cout<<"money must be withdraw by one time"<<endl;}
else cout<<"you can get"<<mony*(1+0.8)<<endl;
}
};
/*class huoqi:public Saving{
double huoqi_lilv;
public:
void lixi(double qianshu)
{cout<<qianshu*(1+0.01);}
};*/
void fn(Saving &m)
{ char ch;
double sn,wn,q;
cout<<"choose your choice"<<endl;
cout<<"(S)ave or (W)ithdraw"<<endl;
cin>>ch;
if(ch=='s')
{cout<<"please input save num"<<endl;
cin>>sn;
m.save(sn);}
else
cout<<"please input withdraw num"<<endl;
cin>>wn;
q=m.show();
if(wn>q)
{
cout<<"your don't have enough money"<<endl;}
else
m.withdraw(q,wn);
}
void main()
{char c;
while(c=='q')
{
cout<<"enter 1 for one year save"
<<"enter 3 for one year save"
<<"enter 5 for one year save"
<<"enter q for quit"<<endl;
cin>>c;
if(c=='1')
{Saving1 s1;
fn(s1);}
else if(c=='3')
{Saving3 s3;
fn(s3);}
else if(c=='5')
{Saving5 s5;
fn(s5);}
}
}

error LNK2001: unresolved external symbol "public: __thiscall Saving5::Saving5(void)" (??0Saving5@@QAE@XZ)
12-4.obj : error LNK2001: unresolved external symbol "public: __thiscall Saving3::Saving3(void)" (??0Saving3@@QAE@XZ)
12-4.obj : error LNK2001: unresolved external symbol "public: __thiscall Saving1::Saving1(void)" (??0Saving1@@QAE@XZ)
Debug/12-4.exe : fatal error LNK1120: 3 unresolved externals
Error executing link.exe.

大家帮忙看看错哪了?


















2006-12-05 12:45
flyly
Rank: 1
等 级:新手上路
帖 子:254
专家分:0
注 册:2006-11-13
收藏
得分:0 
人品问题,鉴定完毕!

2006-12-05 12:46
快速回复:[求助]一个奇怪的错误!
数据加载中...
 
   



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

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