Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
No, I’ve made up my mind about it: if I’m Mabel, I’ll stay down here. It’ll be no use their putting their heads down and saying “Come up again, dear!” I shall only look up and say “Who am I, then? Tell me that first, and then, if I like being that person, I’ll come up: if not, I’ll stay down here till I’m somebody else.”
—Lewis Carroll, Alice’s Adventures in Wonderland
When a function in a single threaded program needs to create private data that persists across calls to that function, the data can be allocated statically in memory. The name’s scope can be limited to the function or file that uses it (static) or it can be made global (extern).