I found on internet that volatile variable tells the compiler that volatile variable can change its contents outside but I don't really understand difference between volatile and none volatile variable? why the volatile keyword should be used.
Code:
#include<stdio.h>
int main(void)
{
volatile int x;
int y;
x = 3;
x++;
y = 3;
y++;
printf("volatile is %d\n", x);
printf("None volatile is %d\n", y);
return 0;
}