Preprocessor Directives Define In C# Language

Introduction

The preprocessors directives are used to help in conduction compilation . This is give information to the compiler  to processes the information before actual compilation starts. All preprocessor directives being # and only white-space characters may appear before a processor directive on a line.

Example

#define PI                 //define Preprocessor

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

 

 

namespace Preproecssor_directives_define_in_c_sharp

{

    class Program

    {

        static void Main(string[] args)

        {

          #if (PI)                           //Check Preprocessor conduction

            Console.WriteLine("PI is defined in preprocessor\n");

          #else

            Console.WriteLine("PI is not defined");

          #endif

           

        }

    }

}


Output


output.jpg


Ebook Download
View all
Learn
View all