1.

Why do we use #error directives in C#?

Answer»

The #error directive is used in C# to GENERATE an error from a particular location in the code.

An example DISPLAYS the same:

using System; namespace Example { CLASS Demo { public static VOID Main(string[] args) { #if (!A)    #error A is undefined #endif Console.WriteLine("A custom error!"); } } }


Discussion

No Comment Found