What is use of "volatile" modifier .....
and can I declare like "const volatile"
Thank you..
What is use of "volatile" modifier .....
and can I declare like "const volatile"
Thank you..
From the standard - 6.7.3 §6 "An object that has volatile-qualified type may be modified in ways unknown to the implementation or have other unknown side effects. [...] What constitutes an access to an object that has volatile-qualified type is implementation-defined."
This mostly indicates the compiler to avoid any optimisation on that variable.
Using const with it is fine.
please give any small sample program with volatile and without volatile
*Sigh*... Let me google that for you
My homepage
Advice: Take only as directed - If symptoms persist, please see your debugger
Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"