Okay, I have a small gap in my knowledge base. When you link a library into your program does the whole library, every function whether you use it or not, get added to your program, or is the linker smart enough so that if you're only using printf that it doesn't add anything but what you need for printf?

Okay, I'm not worried about hello world. Actually it's PDCurses. I just discovered that to get curses to run on my instillation of Code::Blocks that I, in my igorance, made the compiler always link the library for curses. So does this mean that every executable I produce has the entire curses library attached to it, even if I don't #include <curses.h>?

And what about hello world? If all i use is printf in a program are scanf, puts, and the rest hidden in there, dormant and unused?