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?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Question: Write a program that prints a paycheck. Ask the program user for the name of the employee, the hourly rate, and the number of hours worked. If the number of hours exceeds 40, the employee is paid “time and a half”, that is, 150 percent of the hourly rate on the hours exceeding 40. Be sure to use stepwi se refine ment and break your solution into several functions. Use the int_name function to print the dollar amount of the check.

1169


Why is destructor used?

959


What is overloading and its types?

1079


What is solid in oops?

1040


write string class as your own class in java without using any built-in function

2443


Can an interface inherit a class?

1010


Please send ford technologies placement paper 2 my mail id

2057


What are the benefits of interface?

993


write a C++ program for booking using constructor and destructor.

2495


What is the advantage of oop over procedural language?

1006


What are two types of polymorphism?

1014


What is and I oop mean?

1107


What are the 5 oop principles?

1070


Whats oop mean?

988


What is data binding in oops?

1024