Difficulty: Easy
Correct Answer: Dynamic loading
Explanation:
Introduction:
Large systems sometimes need to extend functionality on the fly—for example, by loading plug-ins without stopping the process. This question targets the term for bringing code into a running process image.
Given Data / Assumptions:
Concept / Approach:
Dynamic loading means loading code/data from external modules during execution. On POSIX systems, dlopen/dlsym handle shared objects; on Windows, LoadLibrary/GetProcAddress manage DLLs. This is distinct from dynamic typing (type systems) or dynamic binding (virtual function dispatch); it is about module loading and symbol resolution at runtime.
Step-by-Step Solution:
1) Compile plug-ins as shared libraries.2) At runtime, call the platform loader API to bring the module into memory.3) Resolve function pointers with dlsym/GetProcAddress.4) Invoke newly loaded functionality without restarting the application.
Verification / Alternative check:
Unload and reload modules to confirm swapping behavior; check symbol tables to verify late binding of addresses to function pointers.
Why Other Options Are Wrong:
Data hiding: encapsulation concern, not module loading.Dynamic typing: property of languages like Python, not C++.Dynamic binding: runtime choice among virtual overrides, not loading code.
Common Pitfalls:
Forgetting ABI stability and versioning. Not handling loader errors or symbol name mangling (extern "C" helps for C++ exports).
Final Answer:
Dynamic loading
Discussion & Comments