Home > Net >  [for] c # how to implement the operator overloading
[for] c # how to implement the operator overloading

Time:10-01

How to make the + + operator overloading, operation data of the character, the type a character variable s, when s='C + + s has a value of' D ',

CodePudding user response:

The base type cannot be operator overloading

CodePudding user response:

Well,,,, originally char can do this,

 public static void Main (string [] args) 
{
Char a='C'.
Console. WriteLine (+ + a);

Console.ReadLine();
}
  •  Tags:  
  • C#
  • Related