Use this() to initialize a struct : This : Struct C# Examples


C# Examples » Struct » This »

 

Use this() to initialize a struct









    
public  struct  ComplexNumber
{
      public  ComplexNumber(  double  real,  double  imaginary  )
      {
            this.real  =  real;
            this.imaginary  =  imaginary;
      }

      public  ComplexNumber(  double  real  )  :this()
      {
            this.real  =  real;
      }

      private  double  real;
      private  double  imaginary;
}
    
   
  
   




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Struct
» This