[問題] 呼叫別的.cpp檔內的函數
我有一個寫好的類別 在 CExpense.h 及 CExpense.cpp內 如
class CExpense : public CBase
{
public :
void ConstructL();
~CExpense();
....
}
如果我要在另一個.cpp檔內 呼叫這個 ConstructL() 如
CExpense.ConstructL();
compile時會發生錯誤: expected primary-expression before '->' token
用 CExpense::ConstructL(); 也會錯誤:
cannot call member function `void CExpenseDb::ConstructL()' without object
請問哪裡寫錯了 還是遺漏了什麼 thakns~
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 123.204.20.126
推
08/29 04:57, , 1F
08/29 04:57, 1F
→
08/29 04:58, , 2F
08/29 04:58, 2F
→
08/29 04:58, , 3F
08/29 04:58, 3F
→
08/29 04:59, , 4F
08/29 04:59, 4F
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章