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


Please Help Members By Posting Answers For Below Questions

What is #line in c?

559


Explain the difference between #include "..." And #include <...> In c?

623


Explain how can you avoid including a header more than once?

595


How can you find out how much memory is available?

612


What are the 3 types of structures?

568






what is a NULL Pointer? Whether it is same as an uninitialized pointer?

755


Write a code on reverse string and its complexity.

605


What are the ways to a null pointer can use in c programming language?

588


What is scope of variable in c?

557


can we change the default calling convention in c if yes than how.........?

2030


Do you know the use of 'auto' keyword?

654


what are the different storage classes in c?

660


Why is event driven programming or procedural programming, better within specific scenario?

1949


Why does not c have an exponentiation operator?

625


Explain what is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?

599