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
What is a local variable?
What is #include cstdlib in c++?
How can you link a c program with a c function?
Array base access faster or pointer base access is faster?
Why do we need pointers?
Why is main an int?
Is eclipse good for c++?
Why we use #include iostream in c++?
Write about the stack unwinding?
How would you obtain segment and offset addresses from a far address of a memory location?
Can I learn c++ without learning c?
What is the difference between a declaration and a definition?
Differentiate between a template class and class template in c++?
Can notepad ++ run c++?
Can you please explain the difference between overloading and overriding?