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 |
How much is size of struct having 1 char & 1 integer?
What is an object in c++?
There is a magic square matrix in such a way that sum of a column or a row are same like 3 5 2 4 3 3 3 2 5 sum of each column and row is 10. you have to check that matrix is magic matrix or not?
CAN U SAY WHICH PROGRAMING LANGUAGE IS USED BY DOCTORS....?
What new()is different from malloc()?
Can a class be static in c++?
Can c++ do everything c can?
What are the stages in the development cycle?
What is c++ array?
What are the advantages of C++ programming compared to C programming?
write program for palindrome
81 Answers Amazon, Aricent, CSC, GE, HCL, Infosys, Syntel, Temenos, Wipro,
Which operator can not be overloaded in C++?