What is the use of volatile keyword in c++? Give an example.



What is the use of volatile keyword in c++? Give an example...

Answer / hrpynux@gmail.com

The volatile keyword is intended to prevent the compiler from applying any optimizations on objects that can change in ways that cannot be determined by the compiler. Objects declared as volatile are omitted from optimization because their values can be changed by code outside the scope of current code at any time.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C++ General Interview Questions

How does throwing and catching exceptions differ from using setjmp and longjmp?

1 Answers  


What is the difference between interpreters and compilers?

0 Answers  


What is an accessor in c++?

0 Answers  


What are proxy objects in c++?

0 Answers  


Is swift better than c++?

0 Answers  






What is a storage class?

0 Answers  


How to stop conversions among objects?

5 Answers   Symphony,


If I is an integer variable, which is faster ++i or i++?

0 Answers  


How can a called function determine the number of arguments that have been passed to it?

0 Answers  


Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the maximum number of concurrent threads that the InnoDB plug-in can create

0 Answers  


Give 10 points of differences between C & C++.

0 Answers   HCL,


Can a constructor throw a exception? How to handle the error when the constructor fails?

1 Answers  


Categories