pickzy.com

C  |  C++  |  Objective-C  |  VC++  |  Win32  |  MFC  |  Java  |  Php  |  Delphi  |  Visual Basic  |  .Net  |  Networking  |  General  |  Games  |  Jobs  |  Javascript  |  




Menu

pickSourcecode.com


        

 




 

Cpp > Articles

 

What are C++ storage classes?

What are C++ storage classes?

auto
register
static
extern

auto: the default. Variables are automatically created and initialized 
when they are defined and are destroyed at the end of the block containing their definition. 
They are not visible outside that block

register: a type of auto variable. a suggestion to the compiler to use a CPU register 
for performance

static: a variable that is known only in the function that contains its definition 
but is never destroyed and retains its value between calls to that function. It exists from 
the time the program begins execution

extern: a static variable whose definition and placement is determined 
when all object and library modules are combined (linked) to 
form the executable code file. It can be visible outside the file where it is defined.

 
Privacy Policy | About Us