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

我出现错误“没有重载函数实例”。在cpp文件中的构造函数名称highInterestChecking下,不确定是什么原因导致ive看了一会儿,现在似乎找不到错误。也许有人会帮助?

最佳答案

在标题中,您有:

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)

                                                                                ^^^^^^^^^^^

它带有6参数。似乎int numCheck与标题签名不匹配。

08-27 19:58