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.
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.