Guidance
指路人
g.yi.org
Guidance Forums / wxWidgets (wxWindows) in C++ / Problems with wxArray

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. Problems with wxArray
#4713
Posted by: 2004-07-03 21:15:41
Im trying to load data into a dynamic array.
Here's the declaration

class CData;
WX_DEFINE_ARRAY(CData*, ArrayOfCData);

class CData
{

.....some stuff.....

}

class Foo
{
public:
  ArrayOfCData data;
}

Other .cpp

in a function:

Foo clsfoo;

for (i=0; i <= 3; i++)
{
  clsfoo.data[i]->b=20*i;
}

the problem

somehow it overwrites data[0-2] with data[3], even though I didn't asked him to;
Is this a bug? Are there any suggestions on the problem?

Thanks Meckie
Message2. Re: Problems with wxArray
#4714
Posted by: 2004-07-03 21:35:07
Problem solved,

many roads lead to rome
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
掌柜推荐
 
 
¥880.00 ·
 
 
¥1,390.00 ·
 
 
¥1,380.00 ·
 
 
¥287.00 ·
 
 
¥918.00 ·
 
 
¥860.00 ·
© Sun 2024-11-24  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0