this is the code snippet
static chck()//tracking how many times main has been called
{
    static a=0;
    int y=0;//this is not supposed to work
    cout<<"Total time main has been called:  ";
    a++;
    return a;
}
our teacher told us that static functions can't change or create non static variables but it works for me ,why?
 
     
    