Re: Sharing static variables or function between source files.
- From: "Miles Davis" <miles.pz@xxxxxxxxx>
- Date: 27 Nov 2006 23:20:03 -0800
You can use static var but share a pointer ( which is often a readonly
one)
For example:
a.c:
static int a = 0;
const int * p = &a;
b.c:
extern const int * p;
I use this a lot to reveal something that should be read only for other
files.
"shantanu 写道:
"
Hi,
How can we declare a static variable or function declared in one
source file, which is to be used in other source file?
.
- References:
- Sharing static variables or function between source files.
- From: shantanu
- Sharing static variables or function between source files.
- Prev by Date: Macros
- Next by Date: Re: Sharing static variables or function between source files.
- Previous by thread: Re: Sharing static variables or function between source files.
- Next by thread: Re: Sharing static variables or function between source files.
- Index(es):
Relevant Pages
|
|