We are not reserving space for a variable when we are not going to use it. It reduces confusion. If I mention temp in another part of the program the compiler will say that it cannot see it. This means that if someone else has written a function which uses a local variable called temp there will be no confusion. Scope When talking about variables in this way you often hear the word scope.
Any variable has a given scope .
You could describe the scope of a variable as that portion of a program within which it is meaningful to use that variable. If you declare a variable outside a function it is effectively accessible everywhere. Such variables are often called global, i.e. their scope is the entire program. You have to be careful when you make a variable global. The fact that it can be used in any part of the program means that it can be corrupted in any part of the program.