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

What is the use of "new" operator?

655


Explain data encapsulation?

601


What are the basic data types used in c++?

553


What is a syntax in c++?

603


Where the memory to the static variables is allocated?

558






What is the basic concept of c++?

573


Difference between a homogeneous and a heterogeneous container

659


Which compiler does turbo c++ use?

604


Explain what are single and multiple inheritances in c++?

561


Is c++ slower than c?

571


How do you clear a buffer in c++?

535


Explain the difference between new() and malloc() in c++?

622


Explain linear search.

632


Write about the access privileges in c++ and also mention about its default access level?

615


If you don’t declare a return value, what type of return value is assumed?

540