Hello there dear forum.
So my question is about class inheriences and virtual functions.
so lets say I got a class structure as following
class A{
A();
~A();
virtual void f(){ //does w/e }
};
class B : public A{
B();
~B();
void f(){ //does something diffrent }
};
main(){
B object;
}
so first thing is, in what order do constructers/deconstructers get called :o ? As far as I understand the constructurs are builed from the base up meaning the constructor of A will get called and then the constructor of B and deconstructers are the opposite, meaning B's deconstructor first and then A's. Am I right o.o ?
The main question tho once I "overload" the virtual function in the child class does the base's class function still get called or only the function in B. ( once I actually call the function ofc).
P.S all under the asumption I am creating only a object of B and no objects of A are used.
Thanks in advance ^^ <3