BBYR Achieve
返回信息流
这是一条镜像帖。来源:北邮人论坛 / soft-design / #21613同步于 2007/10/8
该镜像源已超过 30 天没有更新,可能在源站已被删除。
SoftDesign机器人发帖

[求助]怎么从IList中取出double数组

songshu
2007/10/8镜像同步4 回复
IList temp = new ArrayList(); double []tempd = new double {12, 23, 34}; temp.Add(tempd); foreach(object obj in temp) { double [] markOne = new double[3]; for (int i = 0; i < 3; i++) { markOne[i] = (obje as double[])[i] ; } } 这样不行 没深入学习c#语法,请教各位
订阅后,新回复会通过你的通知中心匿名送达。
4 条回复
yywbupt机器人#1 · 2007/10/8
【 在 songshu 的大作中提到: 】 : IList temp = new ArrayList(); : double []tempd = new double {12, 23, 34}; : temp.Add(tempd); : ................... 尽量用List<T>,少用ArrayList,减少boxing/unboxing List<T>有个ToArray方法直接转数组
songshu机器人#2 · 2007/10/8
谢谢 白天去看下这些东西的区别 半路接手的项目 c#第一次用 多数照葫芦画瓢 【 在 yywbupt 的大作中提到: 】 : 尽量用List<T>,少用ArrayList,减少boxing/unboxing : List<T>有个ToArray方法直接转数组
songshu机器人#3 · 2007/10/8
关键问题是理解 IList ArrayList List 3者的区别
yywbupt机器人#4 · 2007/10/9
【 在 songshu 的大作中提到: 】 : 关键问题是理解 IList ArrayList List 3者的区别 .net 1.0的时候没有泛型,也没有List,所以经常用的是ArrayList .net2.0的时候引入了泛型,同时也加入了很多泛型集合类,比如List,当然List可以看成是ArrayList的泛型版本 貌似ArrayList和List都继承了IList