When I create a static variable local to a function:
e.g.
void f(void)
{
static int i = 5;
static int t = GetTickCount();
...
}
Is the variable created/initialized only after the function is called for the first time? Or will it be created/initialized at the beginning of the program (although I don't know how this can be done in the second case). Is this behaviour specified in C/C++?
So if the function f() is called 10s after the program has started, I can be sure that the variable t will be initiallized to 10 instead of something else? Thanks.