我晕,代码改为:
using System;namespace operOver
{
/// <summary>
/// Class1 的摘要说明。
/// </summary>
struct myint
{
public myint(int x)
{
this.x = x;
} public int x;
public static int operator  + (myint x1 ,myint x2)
{
return 10;
}
} class Class1
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main(string[] args)
{
Console.WriteLine(new myint(1) + new myint(1));
}
}}