C/demo versions
Expert: Narendra - 8/27/2006
Question
hello sir
i would like to know about demo verions . and make this ques clear ?
Q:------>
How are portions of a program disabled in demo versions?
ANS----->
If you are distributing a demo version of your program, the preprocessor can be used to enable or disable portions of your program. The following portion of code shows how this task is accomplished, using the preprocessor directives #if and #endif:
int save_document(char* doc_name)
{
#if DEMO_VERSION
printf(“Sorry! You can’t save documents using the DEMO version of this program!n”);
return(0);
#endif
...
}
thank you
monika
AnswerIf they are doing using a #if condition variable,
then you cannot do anything to overcome that in an executable.
The reason is, executable is a compiled code.
That means, preprocessor part is long over.
So, only way left is for you to get the source code and recompile.
For defining or undefining the value of DEMO_VERSION, you can use the compiler itself.
You can pass the value during compilation.