I’m currently looking at a function example that I can’t seem to figure out using MFC in Visual C++. The function is as follows
CMFC_OSG_MDIView::CMFC_OSG_MDIView() :mOSG(0L)
{
}
I understand everything here except the mOSG(0L) snippet. mOSG was declared in the MFC_OSG _MDIView class as follows:
cOSG* mOSG;
The above is a constructor, for a class called
CMFC_OSG_MDIView.:mOSG(0L)is calledinitializer list, which is executed when an object is created. The init-list gets called before the body of the constructor, and it is the correct place to initialize the member variables.