I have a question about volatile in C language.
I read some tutorial but still can not figure out, some says the volatile tells the complier optimizer that operations involving this variable should not be optimized in certain ways. this means anytime the value of a variable is change in register, then the value should affect the memory.
And also some say that volatile mean that the value can be changed by means outside this code.
I can not understand the second saying, so the volatile variable can be changed by means outside of this code? how? and are these two says both right?