Types of storage and scope of each type

Answer Posted / mike

Types of storage class variables in C++:
Automatic.
Extern.
static.

Automatic variables are those which are local to a function
and which are created when the function is called and
destroyed when the function is exited. The memory is
allocated and deallocated on the stack as and when the
function is called and exited.

External variables are global variables and are accessible
to all the functions in the program. They exist throughout
the program.Memory is set when they have have been declared
and will remain till the end of the program.

Static variables are like external varibles which will be
declared within a function and will maintain their values
between function calls.They also exist until throughout the
program

Is This Answer Correct ?    10 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Name the operators that cannot be overloaded in C++?

587


Is std :: string immutable?

565


How a new operator differs from the operator new?

626


Is c++ a good beginners programming language?

584


Briefly describe a B+ tree. What is bulk loading in it?

806






How do you initialize a string in c++?

565


Explain operator overloading.

604


What are the characteristics of friend functions?

567


Why is c++ a mid-level programming language?

594


Specify different types of decision control statements?

358


What c++ library is string in?

581


What does int * mean in c++?

640


Write a program to add three numbers in C++ utilizing classes.

623


What is runtime errors c++?

575


What are keywords in c++?

602