Automatic variable

From Wikipedia, the free encyclopedia

Automatic variables are variables local to a block. They are automatically allocated on the stack when that block of code is entered. When the block exits, the variables are automatically deallocated.

Automatic variables will have an undefined value when declared, so it is good practice to initialize it with valid value before using it.

[edit] See also

In other languages