What is the use of volatile keyword in c++? Give an example.
Answer Posted / 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 View All Answers
What is a class definition?
What are multiple inheritances (virtual inheritance)? What are its advantages and disadvantages?
List the advantages of inheritance.
What is doubly linked list in c++?
How do you import payscale data from non SAP to SAP?is it through LSMW or any other way is there?
Differentiate between a constructor and a destructor in c++.
Write a corrected statement in c++ so that the statement will work properly. if (4 < x < 11) y=2*x;
Which function should be used to free the memory allocated by calloc()?
Is it legal in c++ to overload operator++ so that it decrements a value in your class?
What are the advantages of using typedef in a program?
What is a constructor in c++ with example?
What is static function? Explain with an example
Should you pass exceptions by value or by reference?
What is scope operator in c++?
What are the syntactic rules to be avoid ambiguity in multiple inheritance?