application of static variables in real time
Answer Posted / venugopal
ya.. well before going to know the static variable u need to know the diff b/w static and general variable.
in case of general variable every object have own memory.In case of static variabale all objects share the static data members.
so conclusion is:general members hv own memory so there is no relation b/w one object data to other object data .Static data it maintains relation
uses:
when we open some websites in the homepage we found "hits".It denotes how many users open this site so far.so the "hits" is a integer type we declare it as a static member when i try to open the site my browser acts as a one object and increment the hits value and other person open the site the same increment variable is accessed by other person. my id: venugopal.palavalasa@gmail.com
Is This Answer Correct ? | 4 Yes | 2 No |
Post New Answer View All Answers
What is #line in c?
Explain the difference between #include "..." And #include <...> In c?
Explain how can you avoid including a header more than once?
How can you find out how much memory is available?
What are the 3 types of structures?
what is a NULL Pointer? Whether it is same as an uninitialized pointer?
Write a code on reverse string and its complexity.
What are the ways to a null pointer can use in c programming language?
What is scope of variable in c?
can we change the default calling convention in c if yes than how.........?
Do you know the use of 'auto' keyword?
what are the different storage classes in c?
Why is event driven programming or procedural programming, better within specific scenario?
Why does not c have an exponentiation operator?
Explain what is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?