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

int age=35; if(age>80) {Console.WriteLine("Boy you are old");} else {Console.WrieLine("That is a good age");}

1034


What is this pointer in c++?

1037


What is binary object model?

785


Is c++ primer good for beginners?

797


Would you rather wait for quicksort, linear search, or bubble sort on a 200000 element array? (Or go to lunch...) a) Quicksort b) Linear Search c) Bubble Sort

842


Evaulate: 22%5 a) 2 b) 4 c) 0

872


What is functions syntax in c++?

843


Which bit wise operator is suitable for checking whether a particular bit is on or off?

818


Can we get the value of ios format flags?

872


When the constructor of a base class calls a virtual function, why doesn't the override function of the derived class gets called?

841


What is the protected keyword used for?

856


What does flush do?

769


Describe linkages and types of linkages?

777


Can constructor be private in c++?

786


Which programming language is best to learn first?

802