C++ Storage Classes - Define storage classes in C++.

Define storage classes in C++.

Storage class defined for a variable determines the accessibility and longevity of the variable. The accessibility of the variable relates to the portion of the program that has access to the variable. The longevity of the variable refers to the length of time the variable exists within the program.

Auto :
Automatic variable, also called as local variable and it has scope only within the function block where it is defined.

External :
External variable are defined outside any function and memory is set aside for this type of variable once it is declared and remained until the end of the program. These variables are also called global variables.

Static :
The static automatic variables, as with local variables, are accessible only within the function in which it is defined. Static automatic variables exist until the program ends in the same manner as external variables. In order to maintain value between function calls, the static variable takes its presence.
C++ Iterator class - Define an Iterator class in C++
C++ Iterator class - There are several different types of iterators:...
C++ pure virtual functions related interiew questions and answers
C++ pure virtual functions - What are pure virtual functions?, What is a virtual base class?, What are virtual functions?
ATL Server interview questions and answers - ATL Server FAQ
What is Swing?, What is AWT?, What are the differences between Swing and AWT?, What are heavyweight components? What is lightweight component?
Post your comment