Friday 15 May 2015

c++ - Difference between dynamic loading and dynamic binding -


What is the main difference between dynamic loading and dynamic binding in C ++?

And why is dynamic loading stationary called?

There are many aspects to this question. If we talk about objects that we talk about dynamic binding. Consider the following status

  class base {public: virtual zero method () {std :: cout & lt; & Lt; "Base :: method" & lt; & Lt; Std :: endl; }}; Category received: Public base {Public: Virtual zero method () {std :: cout & lt; & Lt; "Derivative :: Method" & lt; & Lt; Std :: endl; }}; // .... Zero testing method (base * pBase) {pBase-> Method (); }   

The function call is not yet known at the compile time, this can be the base :: method or the derived :: method depending on the runtime type pBase. Thats why dyanmic binding (or late binding) is called, the actual method call is seen when the call is actually going to happen.

On the other hand, we are loading dynamic and stable. It is related to loading libraries. There is a possibility that a static library - a file containing an object code - which is linked to your program, when the compiler Compiles and links it. After compilation, it can not be changed - and this is where the name comes from - to your program steadily.

If you are going for dynamic loading, then load the code on your runtime by adding code to your compile time. Different operating systems offer different methods to do this. DLL files for windows users should not be anything unknown It contains the object code and when the code is requested by the program, it loads the code that provides the code and the DLL that executes the code. With this you can add a different version of DLL without compiling your program (unless the signature and normal behavior remains the same) - we can call it dynamic.

No comments:

Post a Comment