06 Mar, 2007 · 1 minute read
When we compile a program, the code for the various in-built functions are copied from the appropriate libraries. This process of linking of library functions during compilation is called Static Linking.
The process of linking of library functions during runtime is called Dynamic Linking. In Dynamic Linking, the code for the functions are not copied during compilation, rather only a reference to them is added. At runtime, the reference is resolved (when needed) and the code inside the library where the function definition exists is given the control. After completion the control is passed to the application.
Note:- Control here implies the flow of execution.
Dynamic Linking has various advantages when compared to static linking:-
A compiled library file has an extension .dll which stands for Dynamic Link Library.