Hi everyone,
I want to know if there a method where I can lock the access to the header file. I have a header file which I dont want other user to alter or see it. The user can only call the function of the header file without see the content of the file. I just wanted to know how to lock the access to my header file.
Thanks!
Unfortunately such things can only be done in your imagination.
or can I convert the header file to other format so It can't be access by anyone?
You can encrypt it. That'll stop people knowing what's there.
Perhaps you are confused by the difference between an include file and a library file? The include file need only contain the function prototype, which presumably you're going to be calling from some place else anyway.
Your challenge will however remain that people you're trying to protect against are likely more technically astute.
Hi,
Thanks for reply. What I want is the file to be locked and not see by other user. what they can do is call the function without looking at the code. for example, I have a function called frequency in a header file with all the values. what the user can do is just call the function of the frequency instead of looking at the code. I dont want them to see my code.
So you're talking about providing a library/object file which is a compiled version of your source which can be linked against user application code.
So familiarize yourself with the creation of the library/object file as a stand-alone project.
Then familiarize yourself with how you can place that library/object into another project, along with a header/include file that describes the interface.
Pretty much a staple of the software development process.
... that you're so keen to hide it?
As already noted, if it's really valuable, then the kind of people who would steal it are going to be far more proficient in using the tools - so simple, standard techniques like just putting it in a library aren't going to defeat those guys...
Please switch target.
Make it your target to be proficient in C/C++. That will help you way more.
Next thing - a header files shouldn't contain code (unless in some situations when programming inline functions in C++). But that also falls back to the previous item - make sure to get proficient in your programming language.