Thursday, 16 January 2014

WHAT IS AUTO VARIABLES STORED IN C

Where is an auto variables stored

Main memory and CPU registers are the two memory locations where auto variables are stored. Auto variables are defined under automatic storage class. They are stored in main memory. Memory is allocated to an automatic variable when the block which contains it is called and it is de-allocated at the completion of its blockexecution.

Auto variables:

Storage :   main memory.
Default value :   garbage value.
Scope :   local to the block in which the variable is defined.
Lifetime :    till the control remains within the block in which the variable is defined.

No comments:

Post a Comment