I don't know if this is possible.......

i have made a program containing 3 files

1.main.cpp----it includes both complex.h and def.h....main.cpp is simple menu
2.complex.h---class declerations
3.def.h-----definations of the member functions

now i want to give my code to someone....is it possible in some way that.....i give only main.cpp and complex.h to the user...but not show my definations which are in def.h ....but still my program be able to compile and execute at other persons end

this might seem very crazy :rolleyes: to you.....but i guess there must be some way to prevent code protection

It sounds to me like that you want to do is like most implementations: provide header files and object files -- except that you may have put your source code in the header rather than in its own module. I'd recommend putting declarations in the header, putting the definitions in its own module, compiling the module, and then distributing the resulting object file with the header.

yaa actually this is what i mean...i have put the decleration in header file and definations in header file too(which is wrong)...

can u please tell me the steps for this

putting the definitions in its own module, compiling the module, and then distributing the resulting object file with the header.

never done this before

i am using visual studio 6.0

This article has been dead for over six months. Start a new discussion instead.