I'm currently learning C in class and I'm having some confusion understanding volatile variables. My textbook (Computer Programming, by Ajay K. Mittal, Ashok N. Kamthane and Anita Goel) defines them as follows:
Volatile Variables
The volatile variables are those variables that are changed at any time by other external program or the same program. The syntax is as follows.
volatile int d;
What is exactly the difference between the normal variables and volatile variables? If volatile variables can be changed by external programs, how can I change the value from another external program?