Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


what do you mean by static member variable?

Answers were Sorted based on User's Feedback



what do you mean by static member variable?..

Answer / madhu

In C++ when you declare and define a static variable, it
tells the compiler that only one copy of memory will be
allocated and all the objects of that class will share that
copy.
As we know for class data variables memory will be created
independently for every object of that class. and we can
access the data using object. But, for static variables
memory is created only once for all objects and is no object
is owned the static variable. we can access the static
variable using class name.

Mainly static variables are used when want to count the
objects created and destroyed and when we are dealing with
singleton design pattern.

Is This Answer Correct ?    10 Yes 0 No

what do you mean by static member variable?..

Answer / bhaskar

when static member variable executed that variable value is
automatically assigns to zero....

Is This Answer Correct ?    4 Yes 3 No

Post New Answer

More OOPS Interview Questions

What is object and class in oops?

0 Answers  


create a c++ program that will ask 10 numbers and display their sum using array.

1 Answers  


ambiguity regulation of multiple inheritance with example.

1 Answers  


What is difference between class and object with example?

1 Answers  


WHY FUCTION OVERLOADING DOSENOT RETURN A RETEN TYPE

2 Answers  


What are the access specifiers avaible in c++?

4 Answers  


what is difference between objects and function

1 Answers  


what do you mean by static member variable?

2 Answers  


#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

0 Answers  


A file pointer always contains the __________ of the file

5 Answers  


What is inheritance and how many types of inheritance?

0 Answers  


What is an example of genetic polymorphism?

0 Answers  


Categories