systemclass.hC++,在類的構造函數的參數名稱
class SystemClass
{
public:
SystemClass();
SystemClass(const SystemClass&);
~SystemClass();
bool Initialize();
void Shutdown();
void Run();
LRESULT CALLBACK MessageHandler(HWND, UINT, WPARAM, LPARAM);
private:
bool Frame();
void InitializeWindows(int&, int&);
void ShutdownWindows();
private:
LPCWSTR m_applicationName;
HINSTANCE m_hinstance;
HWND m_hwnd;
InputClass* m_Input;
GraphicsClass* m_Graphics;
};
systemclass.cpp後符號
SystemClass::SystemClass()
{
m_Input = 0;
m_Graphics = 0;
}
SystemClass::SystemClass(const SystemClass& other)
{
}
SystemClass::~SystemClass()
{
}
我的問題是關於定義在systemclass.h:
SystemClass(const SystemClass&);
我不記得在這樣的班級名稱後面看到「&」。什麼意思:
const SystemClass&
該代碼來自rastertek.com的C++ DirectX11教程4。
看看http://stackoverflow.com/questions/2564873/reference-parameters-in-c-very-basic-example-please –
其複製構造函數 – BWG