What is the difference between volatile & extern?
Few days back i had an interview but, still I am searching for the answer. I would like to understand the significance of using volatile keyword. Find the code below: Two different scenario. //project1 //File1.c int abc;//Global variable /*And this variable is getting used in some other files too.*/ if(abc == 3) //Say { printf("abc == 3"); } else { printf("abc != 3"); } /*So if or else part will not be optimized because "abc" can not be predicted, the value can chage at any point of time */ //Project2 //file1.c volatile int abc;//Global variable with volatile keyword /*And this variable is