adspace
What do you mean by volatile and mutable keywords used in c++?
Answer Posted / Mudit Kumar
In C++, the `volatile` keyword is used to inform the compiler that a variable's value might be modified by means outside of the program, such as hardware or another thread. On the other hand, the term 'mutable' is not a keyword in C++ but rather a concept used within C++11's std::mutex, where it indicates that the variable can be modified while the mutex is locked, allowing for more efficient synchronization.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers