When volatile can be used?
Answers were Sorted based on User's Feedback
Answer / reejusri
One more thing i want to add in above answer that is if
compiler sees keyword volatile it skips that variable from
optimization of code, becasue since it is very dymanic in
nature and to manage such type of variable for
optimaization is costly.
| Is This Answer Correct ? | 7 Yes | 0 No |
Answer / mustafa
Volatile restricts the compiler in two ways
1-> No optimization algorithm should be applied to this
variable.
2-> When ever you need the value of the volatile variable
please take it from the memory.
| Is This Answer Correct ? | 7 Yes | 0 No |
Answer / qqlin
it means this value will be changed unexpectedly. everytime
the program wants to use it, it can only be got from memory
but not from the register directly.
if you want a variable can be accessed by several threads,
you need this key word, like in ISR program, etc.
| Is This Answer Correct ? | 5 Yes | 0 No |
What is #include iostream in c++?
What is runtime errors c++?
What is a dll entry point?
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
What is a lambda function c++?
which of the following is not an secondary constant a) array b) real c) union
What is the best way to take screenshots of a window with c++ in windows?
What are function prototypes?
How would you differentiate between a pre and post increment operators while overloading?
Explain what data encapsulation is in c++?
What is linked list in c++?
What is fixed in c++?