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

I need to find a specific string between two strings how do I do it?

1 Answers   Infosys,


Differentiate between declaration and definition.

0 Answers  


Why is it called c++?

0 Answers  


Write a program for Divide a number with 2 and Print the output ( NOTE: Check for divide by zero error).

0 Answers  


How would perform Pattern Matching in C++?

0 Answers   Genpact,






What is problem with Runtime type identification?

2 Answers  


reading material is provided 3 books for c++ if u need more do let me know thnx i hve lots of material do let me know if u want it

2 Answers  


How to declare a pointer to an array of integers?

0 Answers  


Do you know what are pure virtual functions?

0 Answers  


How to tokenize a string in c++?

0 Answers  


What is a c++ class?

0 Answers  


Write a String class which has: 1) default constructor 2) copy constructor 3) destructor 4) equality operator similar to strcmp 5) constructor which takes a character array parameter 6) stream << operator

2 Answers   HCL, Lehman Brothers, Zoomerang,


Categories