Static vs. Dynamic Libraries in C

This object code is directly pasted into any program that uses the static library containing the print_alphabet() function: static linking in a nutshell.What are the pros and cons of static and dynamic libraries?Static libraries:╔════════════════════════════╦══════════════════════════════╗║ Pros ║ Cons ║╠════════════════════════════╬══════════════════════════════╣║ 1..No runtime dependencies ║ 1..Uses lots of memory ║║ ║ 2..Needs to be recompiled if ║║ ║ updated ║╚════════════════════════════╩══════════════════════════════╝ vs.Dynamic libraries:╔════════════════════════════╦════════════════════════════╗║ Pros ║ Cons ║╠════════════════════════════╬════════════════════════════╣║ 1..Takes up less memory ║ 1..Library must be present ║║ ║ in order for program ║║ ║ to run ║║ 2..Don't need to recompile ║ 2..Less portable ║║ main program following ║ ║║ an update ║ ║╚════════════════════════════╩════════════════════════════╝Thanks for reading.. More details

Leave a Reply