Consider this code:
main()
{
void postinc();
postinc();
postinc();
postinc();
}
void postinc()
{
static int count=1;
printf("%d", count);
count++;
}
What will be the output?
Make me clear of this static concept.........
What happens to the variable count?
I know that it actually retains its value between funcion calls. But when it is called again and again when the control is passed to the function postinc will the stmt "static int count =1" change the previous value contained by count to 1? or will it still hold the value incremented previously. If it is so, what's the reason behind it?
Please reply me soon..................