How do I call a static method of another class

前端 未结 1 1691
無奈伤痛
無奈伤痛 2020-12-09 00:46

I have a class, lets say CAppPath which has a static method:

public:
    static CString GetAppPath();

and in CAppPath.cp

1条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-09 01:27

    You only need to use the scope resolution operator :: to qualify the method with the name of the class that exposes it:

    CString appPath = CAppPath::GetAppPath();
    

    0 讨论(0)
提交回复
热议问题