評價: 0 回應: 0 閱覽: 99
置頂

呼叫class函數與int

#include <cstdlib>
#include <iostream>

using namespace std;

int VDR = 3000;


void SetVR()
{
 VDR =VDR -100;
 APP->dec(5,4);
}

class APP
{
        public:
                void dec(int x, int y);
};

        void dec(int x,int y)
        {
                int d = x-y;
                cout << d << endl;
        }

int main()
{

    SetVR();
        cout << VDR <<endl;

        system("pause");
        return 0;
}

不曉得如何處理

我已經是使用public為何外部抓不到

會員登入 (先登入會員才能回覆留言喔!)

Facebook留言