您的位置:程序门 -> .net技术 -> vb.net



给结构体中数组赋值


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


给结构体中数组赋值[已结贴,结贴人:csj1995]
发表于:2007-03-29 16:49:29 楼主
public   structure   individual
                public   gene()   as   double
        end   structure
dim   oripool(60)   as   individual  
private   sub   button3_click(byval   sender   as   system.object,   byval   e   as   system.eventargs)   handles   button3.click
                      oripool(59).gene(1)   =23
                msgbox(oripool(59).gene(1))
        end   sub
运行提示“未将对象引用设置到对象的实例”
怎么回事????
发表于:2007-03-29 17:14:041楼 得分:10
先分配数组空间

redim   oripool(59).gene(1)
                oripool(59).gene(1)   =   23
                msgbox(oripool(59).gene(1))
   
*****************************************************************************
欢迎使用csdn论坛专用阅读器   :   csdn   reader(附全部源代码)  

最新版本:20070212

http://www.cnblogs.com/feiyun0112/archive/2006/09/20/509783.html
发表于:2007-03-29 17:17:372楼 得分:0
o...我也明白了.
发表于:2007-03-29 17:17:533楼 得分:0
我之前以为是new的问题呢.
发表于:2007-03-30 08:29:344楼 得分:0
非常正确,谢谢0112


快速检索

最新资讯
热门点击