Home Segments Index Top Previous Next

Chapter 8:

How To Work with Local
and Global Variables

The extent of a variable is the time during which a chunk of memory is allocated for that variable. The scope of a variable is that portion of a program where that variable can be evaluated or assigned.

In this chapter, you learn how C handles extent and scope. In particular, you learn that you can reuse names for parameters and local variables, as long as you do not try to use any name more than once per function.