C++ Programmer Question:

Please explain the volatile and mutable keywords?

Tweet Share WhatsApp

Answer:

The volatile keyword informs the compiler that a variable may change without the compiler knowing it. Variables that are declared as volatile will not be cached by the compiler, and will thus always be read from memory.

The mutable keyword can be used for class member variables. Mutable variables are allowed to change from within const member functions of the class.

Read All 59 C++ Programmer Questions
Previous QuestionNext Question
Explain void* realloc (void* ptr, size_t size)?Do you know what is encapsulation?