:: 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
c++ program to swap the objects of two different classes 468
what type of questions 473
how many types of notations are in java 120
which feature are not hold visual basic of oop? 497
What is the renewal class? 875
What is Difeerence between List obj=new ArrayList(); and ArrayList obj=new ArrayList()? 910
i got a backdoor offer in process global,Bangalore..Can i work with it? 1108
what are the different types of qualifier in java? 577
i am getting an of the type can not convert int to int *. to overcome this problem what we should do? 508
Give two or more real cenario of virtual function and vertual object 646
What is interface? When and where is it used? 439
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 386
How Do you Code Composition and Aggregation in C++ ? 18209
#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 546
write knight tour problem which is present in datastructure 898
E-Mail New Answers        Answer Selected Questions