I have two libraries, to simplify:
libA.lib, libB.lib
libA has function:
void read(num,*val){
*val=Globalval[num];
...
}
libB:
void write(num,val){
Globalval[num]=val;
...
}
that is the gist of what I want to achieve. The two libs are included in my main project files and the functions are called individually. So how do I have this work out? If the two libs were of the same lib, a simply global variable would be all I need.
I’m using microsoft visual studios
In one of the files, probably the write one (libB), put something like this:
In its header file, which should be included by libA, put this:
If your example really is what you’re doing though, keep both functions in the same file, and call them from wherever you need to. In that case, you just put the function prototypes in the header.