Chapter 8. Static and Dynamic Libraries: Hot-swappable code
Youâve already seen the power of standard libraries.
Now itâs time to use that power for your own code. In this chapter, youâll see how to create your own libraries and reuse the same code across several programs. Whatâs more, youâll learn how to share code at runtime with dynamic libraries. Youâll learn the secrets of the coding gurus. And by the end of the chapter, youâll be able to write code that you can scale and manage simply and efficiently.
Code you can take to the bank
Do you remember the encrypt()
function you wrote a while back that
encrypted the contents of a string? It was in a separate source code
file that could be used by several programs:
Somebody else has written a function called checksum()
that can be used to check if the
contents of a string have been modified. Encrypting data and checking if
data has been modified are both important for security. Separately, the two functions are
useful, but together they could form the basis of a security library.
Get Head First C now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.