Re: Sharing static variables or function between source files.



In article <1164683485.633254.38890@xxxxxxxxxxxxxxxxxxxxxxxxxxx>,
shantanu <shantanu.sak@xxxxxxxxx> wrote:
How can we declare a static variable or function declared in one
source file, which is to be used in other source file?

You don't. If you need to use it in another source file, do not
declare it as static, or else find a way to get a pointer to it.

For example, you could add a routine which was

SomeType MyStaticVariable;

SomeType *get_pointer_to_my_static_variable(void) {
return &MyStaticVariable;
}

Then to use the space, get_pointer_to_my_static_variable() and
use the pointer returned by that.
--
All is vanity. -- Ecclesiastes
.