Sunday, August 2, 2009

In C language how to hide part of my code. I tried library file but it still shows the souce.?

I assume by hiding you mean the functionality of dll and ocx - components and objects as in VB.





In C, this is not possible. As you said, if you even use header files, the header file would still contain the source.





But when you develop a complete project in C, normally you do not distribute the source code files. You just would use some custom tool to distribute the compiled obj and exe files.





These compiled files and executables obviously would not be showing your code.





If however, you need to give the source code to your client and still want to hide some portion of your code in it, I am afraid that is not possible in C.





Regards,


C.S. Chandrasekkar

In C language how to hide part of my code. I tried library file but it still shows the souce.?
What?





You mean a comment?





//this


or


/* this */





I don't know what you're talking about when you say "Hide" your code.... when you compile it, you can't get that code back. (well back in C anyway)
Reply:It sounds like you are just including a source file instead of a library. What you really need to do is compile the library functions into a binary library, without symbol tables of debugging info, and include a header file that defines any constants or data structures needed to use the library. This varies from one compiler to another and also by OS.


No comments:

Post a Comment