auto storage class

   
auto storage class Automatic variable specifier

  storage-class-specifier  := auto 

The auto storage class specifier declares a local variable to be automatic. The object is constructed when execution reaches the variable's declaration, and the object is destroyed when execution leaves the scope where it is declared.

All local variables and function parameters are auto by default, so the explicit auto specifier is rarely used.

Example

 int foo(  auto  int parm) {  auto  int sqr = parm * parm;   return sqr; } 

See Also

declaration , register , Chapter 2

   


C++ in a Nutshell
C++ in a Nutshell
ISBN: 059600298X
EAN: 2147483647
Year: 2005
Pages: 270
Authors: Ray Lischner

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net