C++ program that demonstrates preprocessor directives. - C++ Preprocessor

C++ examples for Preprocessor:Directive

Description

C++ program that demonstrates preprocessor directives.

Demo Code

#include <iostream>
using namespace std;
#define AGE 28//from  w  w  w.j  a v  a 2 s.c om
#define MESSAGE "Hello, world"
int main()
{
   int i = 10, age;   
   age = 5;           
   i = i * AGE;       
   cout << i << " " << age << " " << AGE << "\n";
   cout << MESSAGE;   
   return 0;
}

Result


Related Tutorials