what is difference between static and non-static variables

Answer Posted / sv

static variable retains its value like a global variable,
but visible with in the scope.
While non static variable will not be retained one it come
out of the scope or block. Again the visibility is local to
the block.

Is This Answer Correct ?    53 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

If all is successful, what should main return a) 0 b) 1 c) void

823


What is c++ and its uses?

928


What does the following code do: int c=0; cout< a) Undefined *Updated* b) 01 c) 00

859


Write a corrected statement in c++ so that the statement will work properly. if (4 < x < 11) y=2*x;

1781


What is dynamic and static typing?

919


What is near, far and huge pointers? How many bytes are occupied by them?

925


What is #include iostream in c++?

825


What are the various compound assignment operators in c++?

763


Why c++ is called oop?

896


Can we use this pointer in a class specific, operator-overloading function for new operator?

874


Describe the advantage of an external iterator.

839


How can we check whether the contents of two structure variables are same or not?

848


What is the exit function in c++?

788


What are the rules for naming an identifier?

819


How can you differentiate between inheritance and implementation in c++?

951