Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link
URL Rewriter Bot
URL Rewriter Bot

Looking at the link you have posted the example:

public static Complex operator +(Complex c1, Complex c2) => new Complex(c1.real + c2.real, c1.imaginary + c2.imaginary); // Override ToString() to display a complex number // in the traditional format: public override string ToString() => $"{this.real} + {this.imaginary}"; 

strongly suggest that this feature can be applied from the Version of C# 6.0 since also the use of $ as substitute for String.Format exist from the Version of C# 6.0 on and higher.

Try using Visual Studio 2015 to make it work. I did, it worked

Is it possible to update C# version for VS 2012?

Yes, apparently it is. How to do it you will find in this postthis post

Looking at the link you have posted the example:

public static Complex operator +(Complex c1, Complex c2) => new Complex(c1.real + c2.real, c1.imaginary + c2.imaginary); // Override ToString() to display a complex number // in the traditional format: public override string ToString() => $"{this.real} + {this.imaginary}"; 

strongly suggest that this feature can be applied from the Version of C# 6.0 since also the use of $ as substitute for String.Format exist from the Version of C# 6.0 on and higher.

Try using Visual Studio 2015 to make it work. I did, it worked

Is it possible to update C# version for VS 2012?

Yes, apparently it is. How to do it you will find in this post

Looking at the link you have posted the example:

public static Complex operator +(Complex c1, Complex c2) => new Complex(c1.real + c2.real, c1.imaginary + c2.imaginary); // Override ToString() to display a complex number // in the traditional format: public override string ToString() => $"{this.real} + {this.imaginary}"; 

strongly suggest that this feature can be applied from the Version of C# 6.0 since also the use of $ as substitute for String.Format exist from the Version of C# 6.0 on and higher.

Try using Visual Studio 2015 to make it work. I did, it worked

Is it possible to update C# version for VS 2012?

Yes, apparently it is. How to do it you will find in this post

Source Link
Mong Zhu
  • 23.8k
  • 10
  • 47
  • 81

Looking at the link you have posted the example:

public static Complex operator +(Complex c1, Complex c2) => new Complex(c1.real + c2.real, c1.imaginary + c2.imaginary); // Override ToString() to display a complex number // in the traditional format: public override string ToString() => $"{this.real} + {this.imaginary}"; 

strongly suggest that this feature can be applied from the Version of C# 6.0 since also the use of $ as substitute for String.Format exist from the Version of C# 6.0 on and higher.

Try using Visual Studio 2015 to make it work. I did, it worked

Is it possible to update C# version for VS 2012?

Yes, apparently it is. How to do it you will find in this post