c++:没有重载函数的实例
c++: No instance of overloaded function
highInterestChecking Header:
#ifndef H_highInterestChecking
#define H_highInterestChecking
#include "noservicechargechecking.h"
#include <string>
class highInterestChecking: public noServiceChargeChecking
{
public:
highInterestChecking(std::string =" ",int = 0, double = 0.00, double = 0.00, double = 0.00);
};
#endif
highInterestChecking cpp:
#include "highInterestChecking.h"
using std::string;
highInterestChecking::highInterestChecking(string name, int acct, double bal, int numCheck, double min, double i)
{
bankAccount::setAcctOwnersName(name);
bankAccount::setAcctNum(acct);
bankAccount::setBalance(bal);
checkingAccount::setChecks(numCheck);
noServiceChargeChecking::setMinBalance(min);
noServiceChargeChecking::setInterestRate(i);
}
在构造函数名称highInterestChecking下,我有一个错误"没有重载函数的实例"。在cpp文件中检查不确定是什么原因导致了它。我看了一会儿,现在似乎找不到错误。也许有人会帮忙?
在标题中有:
highInterestChecking(std::string =" ",int = 0, double = 0.00, double = 0.00, double = 0.00);
它采用5
参数,在源文件中有:
highInterestChecking::highInterestChecking(string name, int acct, double bal, int numCheck, double min, double i)
^^^^^^^^^^^
其采用CCD_ 2自变量。int numCheck
似乎与标头签名不匹配。
在类声明中有这个构造函数:
highInterestChecking(std::string =" ",int = 0, double = 0.00, double = 0.00, double = 0.00);
类定义中的这个:
highInterestChecking::highInterestChecking(string name, int acct, double bal, int numCheck, double min, double i)
两个参数列表中的参数类型必须匹配。
highInterestChecking::highInterestChecking(string name, int acct,
double bal, int numCheck, double min, double i)
//^^^
不存在于类的头文件中,头文件有5个参数,但在cpp文件中有6个,参数类型似乎不匹配,
相关文章:
- 如何在c++中为模板函数实例创建快捷方式
- 如何使用非默认构造函数实例化模板化类
- C++ - 使用另一个类的构造函数实例化一个对象
- 结构数组的构造函数错误,错误消息:没有构造函数实例与参数列表匹配
- 与参数匹配的友元模板函数实例化
- c++如何获取模板函数实例的地址
- 在保证复制的世界中构造函数实例化
- SFINAE 和模板函数实例化:为什么在启用了 SFINAE 类型的函数参数中使用模板参数时无法推断模板参数?
- 防止复制构造函数实例化 C++11 类"deleting"
- 如何键入定义一个专门的 std::set 模板,使用特定的比较函数实例化
- 没有 std::string .erase() 的重载函数实例
- C 矢量构造函数实例冲突
- 确保只有一个函数实例在运行?
- 使用不同类型的模板函数实例化
- C 调用模板构造函数实例化
- 没有与参数列表错误匹配的重载函数" "实例
- 为什么很清楚模板函数实例化不会内联
- 没有unordered_map的模板函数实例
- 模板函数实例化文件
- 模板函数实例化的可移植性问题