Created
April 24, 2020 16:36
-
-
Save luisdeol/bfad21b4068b8e46a7dd0ed61c1fc105 to your computer and use it in GitHub Desktop.
3.4: Preprocessor directives
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define CUSTOM_DIR | |
// #undef CUSTOM_DIR | |
// undef removes the preprocessor directive definition. Uncomment the code above and notice how the display message changes. | |
using System; | |
namespace _34_DebugAnApplication | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
#if DEBUG | |
Console.WriteLine("Debug mode."); | |
#else | |
Console.WriteLine("Release mode."); | |
#endif | |
#if CUSTOM_DIR | |
Console.WriteLine("CUSTOM_DIR defined"); | |
#else | |
Console.WriteLine("CUSTOM_DIR NOT DEFINED"); | |
#endif | |
#region REGION 1 | |
Console.WriteLine("Region 1"); | |
#endregion | |
Console.ReadLine(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment