Follow Our FB Page << >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...

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 /

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

Which operations are permitted on pointers?

0 Answers  

List the types of polymorphism in c++?

0 Answers  

how to find the maximum of 10 numbers ?

5 Answers  

What are the advantages of inheritance in c++?

0 Answers  

How to declare a function pointer?

0 Answers  

when can we use copy constructor?

6 Answers   HP,

Difference between static global and global?

16 Answers   Microsoft, Symphony, Wipro,

catch(exception &e) { . . . } Referring to the sample code above, which one of the following lines of code produces a written description of the type of exception that "e" refers to? a) cout << e.type(); b) cout <<; c) cout << typeid(e).name(); d) cout << e.what(); e) cout << e;

2 Answers   Quark,

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

0 Answers  

What should main() return in c and c++?

0 Answers  

What happens if an exception is throws from an, object's constructor and object's destructor?

4 Answers   Wipro,

Write a program to calculate the BMI of a person using the formula BMI = weight/height2.

2 Answers