小编Swa*_*nav的帖子

<函数> 不是 <类> 的成员

我已将我的函数“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)" << …
Run Code Online (Sandbox Code Playgroud)

c++ methods compiler-errors class turbo-c++

6
推荐指数
1
解决办法
4万
查看次数

标签 统计

c++ ×1

class ×1

compiler-errors ×1

methods ×1

turbo-c++ ×1