How does early and late binding look like in C++? Can you give example?
I read that function overloading is early binding and virtual functions is late binding. I re
These are true of all object-oriented languages, not just C++.
Static, compile time binding is easy. There's no polymorphism involved. You know the type of the object when you write and compile and run the code. Sometimes a dog is just a dog.
Dynamic, runtime binding is where polymorphism comes from.
If you have a reference that's of parent type at compile type, you can assign a child type to it at runtime. The behavior of the reference will magically change to the appropriate type at runtime. A virtual table lookup will be done to let the runtime figure out what the dynamic type is.