I have a problem regarding static variables. It is said that the life of the static variable is beyond the bounds of the function (if defined in a function). But a pointer to it must give the value if it exits. But it does not work.
#include<stdio.h>
int *p;
int main()
{
clrscr();
test();
printf("%d",*p);
return 0;
}
void test(void)
{
static int chacha=0;
p=&chacha;
}