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

What is inheritance and how many types of inheritance?

854


What is a class and object?

821


What is destructor give example?

841


Why do we use encapsulation in oops?

786


What is cohesion in oop?

866


How to hide the base class functionality in Inheritance?

893


Can a varargs method be overloaded?

844


What is interface? When and where is it used?

1924


Is html an oop?

809


write a program to find 2^n+1 ?

1822


What are the benefits of oop?

906


What is stream in oop?

1075


hi, this is raju,iam studying b.tech 2nd year,iam want know about group1 and group2 details, and we can studying without going to any instutions? please help me.

1766


What is encapsulation in ict?

836


What is an advantage of polymorphism?

848