我晕,代码改为:
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));
}
}}
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));
}
}}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货