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
Does c++ support multilevel and multiple inheritances?
What is polymorphism in c++? Explain with an example?
What does int * mean in c++?
Write a program to add three numbers in C++ utilizing classes.
What is void pointer in c++ with example?
How do I exit turbo c++?
Define basic type of variable used for a different condition in C++?
Why do we need c++?
write a corrected statement so that the instruction will work properly. if (4 < x < 11) y = 2 * x;
What is cin clear () in c++?
How do you write a function that can reverse a linked-list?
What is pointer to member?
Can we sort map in c++?
How do you declare A pointer to function which receives an int pointer and returns a float pointer
What is c++ iterator?