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 is "mutable" keyword?

Answer Posted / shakti singh khinchi

Mutable keyword is used to modify a data member of an object
which has declared as constant. for example:

class XYZ
{
public:
int i;
mutable int cc;
public:
XYZ();
};

int main()
{
const XYZ obj;
obj.cc = 100; // modify obj object's member "cc" which has
been declared as mutable.
}

Is This Answer Correct ?    16 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Difference between overloaded functions and overridden functions

1012


Can a Structure contain a Pointer to itself?

1079


What is runtime polymorphism in c++?

1103


What is c++ code?

1078


What is command line arguments in C++? What are its uses? Where we have to use this?

1195


List down the guideline that should be followed while using friend function.

1015


How the memory management in vectors are being done. What happens when the heap memory is full, and how do you handle it ?

2283


How do you invoke a base member function from a derived class in which you’ve overridden that function?

1070


What is rtti in c++?

1070


Which command properly allocates memory a) char *a=new char[20]; b) char a=new char[20]; c) char a=new char(20.0);

1015


What is the auto keyword good for in c++?

1130


What does obj stand for?

1102


What is unary operator? List out the different operators involved in the unary operator.

948


Are strings immutable in c++?

1124


What's the order in which the objects in an array are destructed?

1356