Site hosted by Angelfire.com: Build your free website today!



Next: Using #ifdef to Up: Conditional selection of Previous: Conditional selection of

Using #ifdef for Different Computer Types

Conditional selection is rarely performed using #defined values. A simple application using machine dependent values is illustrated below.


main()
{
#ifdef vax
      printf("This is a VAX\n");
#endif
#ifdef sun
      printf("This is a SUN\n");
#endif
}

sun is defined automatically on SUN computers. vax is defined automatically on VAX computers.