Hi, I'm working through a Win32 C++ tutorial here: http://www.relisoft.com/win32/index.htm and there's a function definition (and implementation) within a class definition that I don't recognize. I wouldn't be too bothered but they use it all the time. Here's the code:
The bit I don't understand is this:Code:class WinSimpleClass { public: WinSimpleClass (char const * name, HINSTANCE hInst) : _name (name), _hInstance (hInst) {} WinSimpleClass (int resId, HINSTANCE hInst); char const * GetName () const { return _name.c_str (); } HINSTANCE GetInstance () const { return _hInstance; } HWND GetRunningWindow (); protected: HINSTANCE _hInstance; std::string _name; };
Can anyone explain to me what this colon, followed by what appears to be two typecasts of some description(???!!), that precedes the function body means? (i've looked through just about every C++ tutorial to no availCode:WinSimpleClass (char const * name, HINSTANCE hInst) : _name (name), _hInstance (hInst) {})
Any help would be much appreciated.
Thanks,
Dom



LinkBack URL
About LinkBacks
)


