S
saurabh
In the fgollowing program I would like to know,Is there a way to access
the gloabal static a,in my functions.
<code>
#include<stdio.h>
static int a=5;
int increment()
{
/* If we add a variable a in increment function it hides the global
* static a
* I would like to know, if there is a way to access the 'global a'*/
int a=1;
a++;
return a;
}
int main()
{
int x=increment();
printf("\n x=%d\n",x);
return 0;
}
</code>
the gloabal static a,in my functions.
<code>
#include<stdio.h>
static int a=5;
int increment()
{
/* If we add a variable a in increment function it hides the global
* static a
* I would like to know, if there is a way to access the 'global a'*/
int a=1;
a++;
return a;
}
int main()
{
int x=increment();
printf("\n x=%d\n",x);
return 0;
}
</code>