Conditional Compilation
#include "stdafx.h"
#include <iostream>
using namespace std;
int main ()
{
// Conditional compilation
font color="#ffffff"> #define name "Smith"
#ifdef name // Checks if something is defined
cout<< "Hello " << name << endl;
#endif
#undef name
#ifndef name // Checks if something is not defined
cout<< "Sorry name is not defined";
#endif
return 0;
}
Output:
Hello Smith
Sorry name is not defined