:: 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  
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
can inline function declare in private part of class? 1686
what are the different types of qualifier in java? 577
class type to basic type conversion 667
what is difference between class template and template class? 778
There are two base class B1,B2 and there is one class D which is derived from both classes, Explain the flow of calling constructors and destructors when an object of derived class is instantiated. 351
What is nutshell in programming language? 4556
just right the logic of it 1--> If few people are electing then every time ur candidate should win 2--> arrange books in box, if box carry weight == books weight then take another box..... find the no of box required. 3615
write a program to find 2^n+1 ? 355
How to Increment the value of the empid E001 for each and every employee by using the programe? 553
#include <string.h> #include <stdio.h> #include <stdlib.h> #include<conio.h> void insert(char *items, int count); int main(void) { char s[255]; printf("Enter a string:"); gets(s); insert(s, strlen(s)); printf("The sorted string is: %s.\n", s); getch(); return 0; } void insert(char *items, int count) { register int a, b; char t; for(a=1; a < count; ++a) { t = items[a]; for(b=a-1; (b >= 0) && (t < items[b]); b--) items[b+1] = items[b]; items[b+1] = t; } } design an algorithm for Insertion Sort 549
Why can't we have instance(stack) of a class as a member of the same class like eg.Class A{A obj;} as we can have self refential pointer 388
Write A Program to find the ambiguities in Multiple Inheritance? How are they resolved.(Virtual Functions) 2194
Plese get me a perfect C++ program for railway/airway reservation with all details. 2177
how many types of notations are in java 140
How to reverse a sentence in c program ex: ram is a good boy answer: boy good a is ram 1042
E-Mail New Answers        Answer Selected Questions