Question on preprocessor directives
- by dotnetdev
If I use proprocessor directives to define which code an OS will run, like so:
#if winXP // Compiling for Windows XP
platformName = "Microsoft Windows XP";
#elif win2000 // Compiling for Windows 2000
platformName = "Microsoft Windows 2000";
#elif win7 // Compiling for Windows 7
platformName = "Microsoft Windows 7";
#else // Unknown platform specified
platformName = "Unknown";
How does the system pick up which OS is being used?
This is an example from the book Visual C# 2010 Recipes, where the author says that the platformName variable (declaration ommitted), wil equal the OS above.
Thanks