Explain the purpose of the keyword volatile.



Explain the purpose of the keyword volatile...

Answer / Mahaveer Prasad

The 'volatile' keyword in C++ is used to indicate that a variable may be modified by something outside the control of the program, such as hardware or another thread. This tells the compiler not to optimize reads and writes to volatile variables.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C++ General Interview Questions

What are the differences between a struct and a class in C++?

7 Answers   Amazon, Wipro,


What is ostream in c++?

1 Answers  


int main() { int i ,a[i]; i = 0; a[i] = 10; cout<< a[i] << endl; return 0; } What will be output of this program?

11 Answers   HCL, Mphasis,


What jobs can you get with a c++ certification?

1 Answers  


Explain "const" reference arguments in function?

1 Answers  


Is c or c++ more useful?

1 Answers  


pls help.. paper bills.. 1000, 500, 100, 50, 20, 10, 5, 1.. create a program that will count all the paper bills in the number being input.. example: enter a number: 3886 there is/are: 3 ->1000 1 ->500 3 ->100 1 ->50 1 ->20 1 ->10 1 ->5 1 ->1 example2: enter a number: 728 there is/are: 0 ->1000 1 ->500 2 ->100 0 ->50 1 ->20 0 ->10 1 ->5 3 ->1

4 Answers  


What is the use of data hiding?

1 Answers  


Difference between delete and delete[]?

5 Answers   Infosys, TCS, Virtusa,


How would you call C functions from C++ and vice versa?

1 Answers   Genpact,


What is the outcome of cout< a) 16 b) 17 c) 16.5

1 Answers  


How do you clear a map in c++?

1 Answers  


Categories