Use this() to initialize a struct : this « struct « C# / CSharp Tutorial






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;
}








6.5.this
6.5.1.Use this() to initialize a struct