|
Static Variables
If I want to define a variable inside of a function and want it to be available to all functions in the .c file, will static do it?
Would this work?
void FunctitonWhatever1(void)
{
static int bob=1;
/*Note the static and the =1*/
CallerFuction();
}
void CallerFunction(void)
{
int bill=0;
/*Only need it in this function*/
bill=2+bob;
}
__________________
I quit FRC over 2 years ago (more if you're reading this past 2010).
|