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 |