1.

How Are Portions Of A Program Disabled In Demo Versions?

Answer»

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 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:



Discussion

No Comment Found