application of static variables in real time



application of static variables in real time..

Answer / 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

More C Interview Questions

write a c prog for removing duplicate character from an array and sorting remaining elements using a single array

1 Answers  


Convert the following expression to postfix and prefix X $ Y Z - M + N + P / Q / (R + S)

2 Answers  


What is a substring in c?

0 Answers  


How pointers are declared?

0 Answers  


any C program contains only one function, it must be a) void () b) main () c) message () d) abc ()

0 Answers  


what is the difference between normal variables and pointer variables..............

15 Answers   HP, Infosys, Satyam, Vivekanand Education Society,


is forign key will be unique key any table or not?

2 Answers  


Explain the advantages and disadvantages of macros.

0 Answers   TCS,


What is actual argument?

0 Answers  


C program to find all possible outcomes of a dice?

0 Answers  


i have a written test in tomorrow

1 Answers   NNN, Value Labs,


What is difference between function overloading and operator overloading?

0 Answers  


Categories