Loading

摘要: Q1:首先定义一个结构public struct MyStruct { public int T; }定义一个泛型List来存放结构体,然后访问第一个元素去修改T,输出T:List arrLis =new List(){new MyStruct()}; arrLis[0].T = 100;Console.WriteLine(arrLis[0].T);大家猜是什么结果?很遗憾不是100,arrLis[0].T = 100;VS提示该语句有错误。Cannot modify the expression because it is not a variable.说修改的不是一个变量。这是为什么呢?关 阅读全文
posted @ 2013-11-29 13:38 Agile.Zhou 阅读(2518) 评论(3) 推荐(5)