基本クラスを継承すると、そのようなクラスがないことがわかります
これは Enhanced.h:
class enhanced: public changeDispenser // <--------where error is occuring
{
public:
void changeStatus();
// Function: Lets the user know how much of each coin is in the machine
enhanced(int);
// Constructor
// Sets the Dollar amount to what the User wants
void changeLoad(int);
// Function: Loads what change the user requests into the Coin Machine
int dispenseChange(int);
// Function: Takes the users amount of cents requests and dispenses it to the user
private:
int dollar;
};
これは Enhanced.cpp です:
#include "enhanced.h"
#include <iostream>
using namespace std;
enhanced::enhanced(int dol)
{
dollar = dol;
}
void enhanced::changeStatus()
{
cout << dollar << " dollars, ";
changeDispenser::changeStatus();
}
void enhanced::changeLoad(int d)
{
dollar = dollar + d;
//changeDispenser::changeLoad;
}
これは changeDispenser.h です。
class changeDispenser
{
public:
void changeStatus();
// Function: Lets the user know how much of each coin is in the machine
changeDispenser(int, int, int, int);
// Constructor
// Sets the Quarters, Dimes, Nickels, and Pennies to what the User wants
void changeLoad(int, int, int, int);
// Function: Loads what change the user requests into the Coin Machine
int dispenseChange(int);
// Function: Takes the users amount of cents requests and dispenses it to the user
private:
int quarter;
int dime;
int nickel;
int penny;
};
ドライバー ファイルや changeDispenser imp ファイルは含めませんでしたが、ドライバーにはこれらが含まれています。
#include "changeDispenser.h"
#include "enhanced.h"