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

What is c++ & why it is used?

833


Why c++ is faster than java?

833


How is objective c different from c++?

1014


which of the following is not an secondary constant a) array b) real c) union

1549


What is using namespace std in cpp?

777


Explain deep copy?

817


If you hear the cpu fan is running and the monitor power is still on, but you did not see anything show up in the monitor screen. What would you do to find out what is going wrong?

823


How would you use the functions sin(), pow(), sqrt()?

951


When to use “const” reference arguments in a function?

827


What are manipulators in c++ with example?

805


What are all predefined data types in c++?

813


What are register variables?

854


Can we get the value of ios format flags?

878


What is capacity in vector in c++?

768


How do we implement inheritance in c++?

845