Wikipedia:

automatic variable


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. Note that automatic variables are often called local variables.

The C storage class for automatic variables is auto; however auto is assumed unless otherwise specified. The basic syntax used to declare automatic variables in C is as follows

[storage_class] data_type variable_1, variable_2, ... variable_n;

An automatic variable will have an undefined value when declared, so it is good practice to initialize it with a valid value before using it.

See also


 
 
 

Join the WikiAnswers Q&A community. Post a question or answer questions about "automatic variable" at WikiAnswers.

 

Copyrights:

Wikipedia. This article is licensed under the GNU Free Documentation License. It uses material from the Wikipedia article "Automatic variable" Read more

Search for answers directly from your browser with the FREE Answers.com Toolbar!  
Click here to download now. 

Get Answers your way! Check out all our free tools and products.

On this page:   E-mail   print Print  Link  

 

Keep Reading

Mentioned In: