本帖最后由 wang_hongbo 于 2010-05-01 03:36:29 编辑

解决方案 »

  1.   

    test1[] mytest1 = new test1[4] { new test1(), new test1(), new test1(), new test1() };
      

  2.   

    1.struct是值类型class是引用类型
    2.实例化时class必须要通过new来实例化而struct可以不是有new关键字,如果不以new关键字实例化struct那么它将其所有字段处于未分配状态直到所有字段初始化。
    建议使用楼上的
    test1[] mytest1 = new test1[4] { new test1(), new test1(), new test1(), new test1() };否则会编译错误出现未将对象引用到对象的实例。
    就类似于没有兔子怎么直到兔子是什么颜色呢自己的见解呵呵呵。