what is difference between static and non-static variables

Answer Posted / daxini

Static :
A static variable is defined for the class itself and exists independently of any object of that class.
non-static:
a non static variable is defined for object of the class thus it is bound to an instance of its class

Is This Answer Correct ?    10 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What type of question are asked in GE code writing test based on c++ data structures and pointers?

3722


Describe exception handling concept with an example?

773


What is command line arguments in C++? What are its uses? Where we have to use this?

871


When should we use container classes instead of arrays?

807


What is a block in c++?

796


the maximum length of a character constant can be a) 2 b) 1 c) 8

895


How new/delete differs from malloc()/free?

877


Why cstdlib is used in c++?

798


What are the extraction and insertion operators in c++? Explain with examples.

912


Explain function overloading and operator overloading.

831


Is c++ primer good for beginners?

797


Does there exist any way to make the command line arguments available to other functions without passing them as arguments to the function?

996


Differentiate between late binding and early binding. What are the advantages of early binding?

806


What is linked list in c++?

905


What is a driver program?

865