home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Devil's Doorknob BBS Capture (1996-2003)
/
devilsdoorknobbbscapture1996-2003.iso
/
Dloads
/
OTHERUTI
/
MASTER-1.ZIP
/
SOURCE
/
CHAP03
/
DEMOCPP.C
Wrap
C/C++ Source or Header
|
1992-06-12
|
486b
|
25 lines
/* DEMOCPP.C
Demonstrates the usage of the CPP preprocessor.
*/
#include <stdio.h>
#define prompt1 "Good, Morning"
#define prompt2 "Good, Afternoon"
/* Use this for conditional compilation */
#define useprompt1 1
/* Illustrate macro expansion */
#define sumit(a,b,c) ( (a) + (b) + (c) )
void main( void )
{
#ifdef useprompt1
printf("%s\n", prompt1);
#else
printf("%s\n", prompt2);
#endif
printf("The sum of 7 + 9 + 11 is: %d\n", sumit(7,9,11) );
}