inheritance, pointercast

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Rasmus

    #1

    inheritance, pointercast

    Hi, here a quick question:

    I have class A,B,C where B and C is extended from A.

    I would like to construct A objects like:

    A *a3 = new A(a1, a2);

    and a3 should be an object of type B or C.

    Is this possible?
    | true: How?
    | false: Can you give me a nice solution?

    Thanks for your time
    Rasmus





Working...