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
Does sprintf put null character?
Explain the concept and use of type void.
Why shouldn’t I start variable names with underscores?
How do you print only part of a string?
Is it possible to initialize a variable at the time it was declared?
Is c easier than java?
When do we get logical errors?
Can I use base-2 constants (something like 0b101010)? Is there a printf format for binary?
How many types of operators are there in c?
Can you pass an entire structure to functions?
What is keyword with example?
What is the general form of #line preprocessor?
Suggesting that there can be 62 seconds in a minute?
What are the two forms of #include directive?
What does static variable mean in c?