title: What is the difference between a static global and a static volatile variable?
body: <p>I have used a static global variable and a static volatile variable in file scope,
  <p> both are updated by an ISR and a main loop and main loop checks the value of the variable. <p>here during optimization neither the global variable nor the volatile variable are optimized. So instead of using a volatile variable a global variable solves the problem. 
  <p>So is it good to use global variable instead of volatile?
  <p>Any specific reason to use static volatile??
  <p>Any example program would be appreciable.
  <p>Thanks in advance..</p>