As a sort of lame approach to explaining static variables in functions to noobs (like myself), could you say that, FOR THE FUNCTION IN QUESTION, the following:
is roughly the same as:Code:void func(void)
{
static int x = 5;
x++;
}
Don't kill me if this is so wrong, I've just started fiddling around with static. :)Code:int x = 5;
void func(void)
{
x++;
}