C++ Learning Resource Network!

 
 
 C++ Tutorials  >  Data Types & Structures  >  auto Storage type
 

auto Storage Type

Data pertaining to a function is lost when the function has completed execution. Variables defined in a function are in memory and retain their value only as long as the function is in execution.

In C++, such data has been classified as data of storage type auto. So fas, all functions have been written using auto type data. Declaration like:

int iVar;
char cVar;
invoice Ivar1;


are, by default, treated as:

auto int iVar;
auto char cVar;
auto invoice Ivar1;


The word auto may be used in declarations for clarity.

 

| Bookmark This Site |   | Links |   | Search |   | Submit |   | Contact |

  Copyright 2008 - 3008  CppTutor.com All rights reserved.