int x;
in the test1
formal parameter list is a variable local to test1
. It has similar status to if you also went int y;
as a declaration inside test1
. It has automatic storage duration.
After test1
exits, the variable no longer exists.
Typically, compilers implement automatic storage via a block of memory that contains a stack structure. When you call a function, new space is claimed on top of the stack for that function's automatic variables (and the return address, and any registers that need to be saved); and when you leave the function, the stack is "popped" back to where it was before you called the function.