Does dynamic biding only happen with object on heap in C++?
- by skydoor
Will dynamic binding happen with the object on stack?
For example
f() is a virtual function in both Base and Derived
int main(){
Derived d1;
Based *b= new Derived();
d1.f();
b->f();
}