Hiding simple code using a header file?

318 views Asked by At

EDIT: My question isn't a duplicate of this question, which addresses a conceptual question regarding the usage of Templates. Whereas, the focus of this question is on Hiding code in a header file. While my case involves template functions and thus it's not possible to hide them, answers addressing non-template header files are also appreciated.

QUESTION: How to hide non-template code written in header files from the user? By hiding, I mean something that the system can read by not the user by any means. i.e.: Binary files.

I have a header file containing about 8 template functions. I want to share the header file with my classmates so they can use it but I don't want to share the entire source code with them. Instead of sending them the header file which they can include and use, can I just send them some binary object, which they can link to their code while compilation or something?

I looked up about dynamic and static libraries although not much is present regarding Turbo C++. All that I found was based on usage of GCC.

I wish to be able to send a static library, I even created a .lib file by making a project, adding the header and implementation file but I don't know how to use the said .lib file. As I said, didn't find much related to Turbo C++, most stuff is on simple creation of header files.

Note: I hate TurboC++ but my school is dumb, actually the entire country is dumb, especially in this matter.

0

There are 0 answers