When writing OO code I quite often use the constructor to pass sub class instances which means my sub classes always have a constructor like the C# example below. Is this ok or is their a better way?
class baseClassA
{
protected baseClassB m_ClassB;
public baseClassA(baseClassB classB)
{...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.