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
   Testimonials 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 In Companies :: HCL,     < I also faced this Question! >
 Question Submitted By :: saroj
  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
 
 
Please Help Members By Posting Answers For Below Questions
 
 Question Views   Select
 
write a C++ program for booking using constructor and destructor. 590
how to get the oracle certification? send me the answer 374
What is nutshell in programming language? 4425
design a c++ class for the chess board,provide a c++ class definition for such class(only class definition is required) 3539
They started with the brief introduction followed by few basic C++ questions on polumorphism, inheritance and then virtual functions. What is polymorphims? How you will access polymorphic functions in C? How virtual function mechanism works? 278
what is difference between class template and template class? 710
write a program to enter a string like"sunil is a good boy and seeking for a job" not more than 10 characters including space in one line,rest characters should b in other line.if the next line starts from in between the previous word,then print whole word to next line. 519
I have One image (means a group photo ) how to split the faces only from the image?............ please send the answer nagadurgaraju@gmail.com thanks in advace... 360
Get me a number puzzle game-program 466
write a code for this:trailer recordId contains a value other than 99, then the file must error with the reason ‘Invalid RECORD_ID’(User Defined Exception). 531
write a program to find 2 power of a 5digit number with out using big int and exponent ? 446
when to use 'mutable' keyword and when to use 'const cast' in c++ 437
Will I be able to get a picture in D drive to the c++ program? If so, help me out? 555
How to reverse a sentence in c program ex: ram is a good boy answer: boy good a is ram 973
Prepare me a program for the animation of train 786
E-Mail New Answers        Answer Selected Questions