if the variable is initialized (i = 0), it's still 1 each time the function func is called, BUT
when i is not initialized:
#include <stdio.h>
int funct(void);
int main(void)
{
funct();
funct();
funct();
return 0;
}
int funct(void)
{
int i;
static int j = 0;
i++;
j++;
printf(" i = %d j = %d\n", i, j);
}
the output is
i = 1 j = 1
i = 2 j = 2
i = 3 j = 3
I don't understand why the variable i behaves like a static one!