what is difference between static and non-static variables

Answer Posted / achal ubbott

The above answers are correct. A local static variable is
stored in heap. But a local variable is stored onto stack.

A Global variable made static can't be accessed from a
function outside the file using extern. So it limits the
scope.

Is This Answer Correct ?    2 Yes 10 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain how a pointer to function can be declared in C++?

797


List the types of polymorphism in c++?

865


What is an inline function in c++?

891


What is rtti in c++?

887


Explain "const" reference arguments in function?

843


Explain explicit container.

873


Is python written in c or c++?

898


Is vector a class in c++?

834


Explain Memory Allocation in C/C++ ?

840


Which software is used to run c++ program?

761


Which is better c++ or java?

783


What is a tree in c++?

761


Do inline functions improve performance?

858


What is the use of typedef?

857


What is difference between class and function?

840