[edited for C++]I am not sure when I should create class directly or using parent to init. Example :
class A : class B
USING :
1)
A* a = new A();
2)
B* a = new A();
Because of project 's requirement, I have to use number 2 . But I wonder what is better for performance ???
And if the performance of number 2 is bad, I will consider to using number 1 with a longer code :(
I think this is a good answer :
Virtual functions and performance - C++