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
Explain how do you print only part of a string?
find the value of y y = 1.5x+3 for x<=2 y = 2x+5 for x>2
What is the difference between struct and typedef struct in c?
How can I dynamically allocate arrays?
Why is main function so important?
What is the benefit of using #define to declare a constant?
Which is best linux os?
What is main return c?
Explain what’s a signal? Explain what do I use signals for?
Where define directive used?
why wipro wase
Is c dynamically typed?
How many levels of indirection in pointers can you have in a single declaration?
Why array is used in c?
hi... can anyone help me to make a two-dimensinal arrays in finding the sum of two elements plzzz. thnx a lot...