i have created 3 functions in different files (i mean different main.c files) how can i create a header file and put all these functions in it as well as the main program that uses all these functions? i mean how can i create a header*.h file and put the functions and my program in it?Thanks a lot
It is not clear what you already have. You know that in one project (program), you cannot have 3 main functions. So I pressume you have 3 functions like add(), sub(), and mul(). If you so, you create a file called myheader.h had put the followings in it:
Note that the above is a sample. You should put your real functions instead.
Now you can either put the functions themselves in this header file (before #endif) or put them in a separate file. If you put them in a separate file (e.g myfunc.cpp), don't forget to put the followinh line at the begining:
Now create another file (say mymain.cpp) and put your main function in there. At the begining put the following: