A
A
Andrean4ik2016-10-17 00:40:57
OOP
Andrean4ik, 2016-10-17 00:40:57

Initializing an object by base class?

Please tell me how to implement such a constructor:

Class Derived : BaseClass
{
  public Derived(BaseClass bc)
  {
  // Как быть дальше???
  }
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrean4ik, 2016-10-17
@Andrean4ik

Class Derived : BaseClass
{
  public Derived(BaseClass bc) : base (bc.x, bc.y, bc.z) // и т.д. и т.п
  {
  
  }
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question