You will need to create a header file and prototype the functions that are going to be shared, like
my_share.h
bool my_func(int nVal = 0);
my_share.c
bool my_func(int nVal)// = 0);
{
// actual codes
return true;
}
Alternatively, a better approach would be to create a class and have everything in a single header file. You can find one such example in
OriginC\System\Profiler.h
Since all the member functions are implemented inside the class, then you can just include this in any file that you will need to use this class. For example,
myTest.h
class myTest
{
myTest() // constructor
{
m_str = "Hello world\n";
}
public:
void DoSomething()
{
printf(m_str);
}
private:
string m_str;
};
then in one of your C file, then just
#include <origin.h>
#include "myTest.h" // header in same path as c file
void test()
{
myTest tt;
tt.DoSomething();
}
CP
Edited by - cpyang on 01/28/2004 11:10:12 PM