   Inheritance problem
  Hi,I have the following base class:class CState{public:// constructorCState( unsigned long ulID = 0 ) { m_ulID = ulID }// state methodsvirtual void VLoad();virtual void VClose();virtual void VUpdate( float fElapsed );virtual void VRender();// accessorunsigned long GetID();protected:// application defined IDunsigned long m_ulID;};The following class inherits from it:class CTestState : public CState{CTestState( unsigned long ulID ) : CState( ulID ){// emptyreturn;}// virtual function overloads ommited...};To the best of my knowledge, this should be fine. However, the compiler emits the following errors:winmain.cpp(49) : error C2248: 'CTestState::CTestState' : cannot access private member declared in class 'CTestState'   winmain.h(73) : see declaration of 'CTestState::CTestState'winmain.h(70) : see declaration of 'CTestState'I have read that this could be a compiler error, but I don't want to shift the blame on Microsoft too soon (I'm using VC 2005). Is there anything I'm missing? I get the feeling it's something stupid...Many thanks for any help :)   
  Class members default to private, and it looks to me as if you did not make your CTestState c-tor public. I don't know if you ommited this just for your sample, or in your code as well. If you did forget it in your code, try putting it in. Also, there is no need to return; in a constructor.   ;  That's exactly it. Didn't I say it was something stupid?Thanks a lot.*Smacks forehead*   ;  BTW:- Why would you have a 'return' statement at the end of your constructor? I'm pretty sure that isn't valid.- If you're smart enough to use the initializer list for the base class within the derived class, why aren't you using it for the member within the base class?   ;Quote:Original post by Zahlman- Why would you have a 'return' statement at the end of your constructor? I'm pretty sure that isn't valid.Nope, that's not invalid. Pointless waste of space, but not invalid.Quote:- If you're smart enough to use the initializer list for the base class within the derived class, why aren't you using it for the member within the base class?Indeed.   