Swa*_*nav 6 c++ methods compiler-errors class turbo-c++
我已将我的函数“Credit”声明为带有一些参数的私有成员。我的观察是,每当我尝试在没有任何参数的情况下进行编译时,编译器都会成功编译。但是一旦我使用函数中的参数进行编译,编译器就会给出错误
“交易::信用”不是“交易”的成员
这是我的代码
class Transaction : public Menu
{
private :
void Credit(int depost);//{ return 0;}
public :
void Deposit();
void Withdraw(){}
void Transfer(){}
};
void Transaction :: Deposit()
{
char custid[10]; int deposit;
clrscr();
cout << endl << endl << endl << endl << endl;
cout << "\t\t\t\t DEPOSIT " << endl;
cout << "\t\t Please enter your Customer ID" << endl;
cin >> custid;
cout << "\t\t Please enter the amount you want to deposit (in Rupees)" << endl;
cin >> deposit;
// Credit (depost);
}
void Transaction :: Credit (depost)
{
}
Run Code Online (Sandbox Code Playgroud)
我使用的是 Turbo C++,所以请根据这个 IDE 指导我。
您缺少存款类型:
void Transaction :: Credit (int depost)
Run Code Online (Sandbox Code Playgroud)