Original Post
I've run across some code like below: It's only pieces of the actual source. What I'm confused on is how RenderDevice is an object of RENDER (the function pointer) and then cast on the next line. Can someone explain why this works or point to a site that explains it?
// Located in .h file
HRESULT CreateDevice(CInterface **pInterface, HINSTANCE dll);
typedef HRESULT (*RENDER) (CInterface **pInterface, HINSTANCE dll) // functions pointer to above function
// Located in .cpp file
HRESULT hr;
RENDER RenderDevice = 0;
RenderDevice = (RENDER) GetProcAddress(m_DLL, "CreateDevice");
hr = RenderDevice(pDevice, m_DLL);