C# Program to Demonstrate the #Warning Preprocessor Directive

Everyone has every option I have C# Program to Demonstrate the #Warning Preprocessor Directive I have the option to write this article. I am writing this article to resolve your doubts. We ask that you understand this article well.

C# Program to Demonstrate the #Warning Preprocessor Directive

C# Program to Demonstrate the #Warning Preprocessor Directive

//C# program to demonstrate the 
//#warning preprocessor directive.

#define MACRO1
#define MACRO2
#define MACRO3
#undef  MACRO2

using System;

class Program
{
   public static void Main()
   {
        #if (!MACRO2)
            #warning MACRO2 is not defined
        #endif
    }
}
Warning	1	#warning: 'MACRO2 is not defined'

Final Words

We hope the C# Program to Demonstrate the #Warning Preprocessor Directive article fills your doubts. And let us know if you have any doubts. We resolve your doubts Thank you.

Hi, I'm Ranjith a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coding Deekshi. Here, I post about programming to help developers.

Share on:

Leave a Comment