what is a ststic variable and stiticfunction
briefly explain with exmple and in which case we use

Answer Posted / subhashish sen

When a variable is declared with static keyword,its called
as static variable,means it retains its value across
different function calls.Its basically used for counting no
of objects created for a class in C++ and its initialized to
0 by default.

When a function declared as static,its called as static
function.It can only operate on static variables.

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the advantages of inheritance.

675


How do you define a class in oop?

628


what is graphics

2011


What is encapsulation c#?

600


What does and I oop mean in text?

625






if i have same function with same number of argument but defined in different files. Now i am adding these two files in a third file and calling this function . which will get called and wht decide the precedence?

2760


What is new keyword in oops?

593


Can main method override?

585


write knight tour problem which is present in datastructure

2166


What is encapsulation with example?

581


What is difference between multiple inheritance and multilevel inheritance?

603


When not to use object oriented programming?

572


write a C++ program for booking using constructor and destructor.

2051


What are the features of oop?

641


What is interface in oop?

664