A static variable inside a function is only allocated once during the lifetime of the program.
So if I have a function like:
void f(int n) {
static int *a = new int[n];
}
and I first call
f(1)
and then
f(3)
how big will the array a be after the second call?