用了list<> 的自定义结构,为什么不能赋值??
using System;using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication3
{
struct info
{
public string qq;
public string tel;
public info(string a, string b)
{
qq = a;
tel = b;
}
}
class Program
{
static void Main(string[] args)
{
info bb = new info("asdfasdf", "2224536");
System.Console.WriteLine(bb.qq );
System.Console.WriteLine(bb.tel);
bb.qq = "dfhsdh";
System.Console.WriteLine(bb.qq);
List<info> cc = new List<info>();
cc.Add(new info("bbbbb","342567"));
System.Console.WriteLine(cc[0].qq );
System.Console.WriteLine(cc.Count.ToString() + "个数");
cc[0].tel = "97655678";
}
}
}
//
错误 2 无法修改“System.Collections.Generic.List<字符查找.px排序表格结构>.this[int]”的返回值,因为它不是变量 E:\字符查找-c#\字符查找\字符查找\Form1.cs 132 29 字符查找