C++ Programmer Question:
Download Questions PDF

Please explain the volatile and mutable keywords?

C++ Programmer Interview Question
C++ Programmer Interview Question

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.

Download C++ Programmer Interview Questions And Answers PDF

Previous QuestionNext Question
Explain void* realloc (void* ptr, size_t size)?Do you know what is encapsulation?