Hi,

I have a function, foo(), defined in a file a.c which defines and uses a 
variable named xxx. Now i have another function, bar(), defined in some other 
file, b.c, which also uses a static variable named xxx. Now foo() calls bar() 
and both manupilate xxx. Can something go wrong here?

The two functions foo() and bar() go something like this:

func foo() /* defined in a.c */
{
  int xxx = 0;

  bar(&xxx);

  /* Some more processing is done on xxx */

  printf ("%d\n", xxx)
}

bar (int *yyy) /* defined in b.c */
{
  int z = xxx; /* xxx is a static variable defined in the file b.c */

  /* Do some Processing on z */

  *yyy = z;
}

Any help in this regard would be really appreciated.

Thanks,
Tulip


      Get a sneak peak at messages with a handy reading pane with All new 
Yahoo! Mail: http://mrd.mail.yahoo.com/try_beta?.intl=ca

Reply via email to