Binding in C++ means associating the call of a function with the definition of that function. There are two types of binding in C++: static and dynamic binding (early and late binding)
Static binding happens at compile-time and dynamic binding happens at run-time.
The main advantage of static binding is that the program runs a little bit faster, and if we use dynamic binding (because binding happens in run-time) our program runs a little bit slower.
The main advantage of dynamic binding is that it is very flexible, and it allows us to decide at run-time which function definition we want to invoke.
Static binding happens by default, and it is achieved via normal function calls, function overloading, or operator overloading.
Dynamic binding is achieved by using virtual functions or function overriding.
#cplusplus #programming #developer