A
Angus
Hello
I want to use polymorphic feature.
Eg if I had a base Shape class and a derived Circle class I could do
things like this:
Shape myShape;
MyCircle* pCircle = &myShape;
pCircle->SetValues(3,5);
cout << pCircle->area();
But my derived class has a constructor which gets passed variables.
Eg
Derived(int var1, std::string var2)
So how do I instantiate it?
I tried Derived* pDer(params);
I want to use polymorphic feature.
Eg if I had a base Shape class and a derived Circle class I could do
things like this:
Shape myShape;
MyCircle* pCircle = &myShape;
pCircle->SetValues(3,5);
cout << pCircle->area();
But my derived class has a constructor which gets passed variables.
Eg
Derived(int var1, std::string var2)
So how do I instantiate it?
I tried Derived* pDer(params);