ALLInterview.com :: Home Page      
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   Errors
   Refer this Site  Refer This Site to Your Friends  Site Map  Contact Us      
   
 
Categories >> Software >> Programming Languages >> C++ >> OOPS
 
 


 

 
Question what is a ststic variable and stiticfunction
briefly explain with exmple and in which case we use
 Question Asked At :: hcl
 Question Submitted By :: saroj
I also faced this Question!!    
Answer Posted By  
 
Answer
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


 
  subhashish sen
 
View All Answers