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

Recommended Answers

All 3 Replies

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

[post=106155]Here[/post] is a very simplified example of something similar.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.