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 ... }
If you have the better answer, then send it to us. We will display your answer after the approval.