This is the question :
How to do IT Right ?
IT = add objects dynamically (mean create class structures to support that)
class Branch
{
Leaves lv; //it should have many leaves!!
}
class Tree
{
Branch br; //it should have many branchs!!!
}
Now a Non-Working Example (neither is c++ !!, but I try to draw the idea)
class Branch
{
static lv_count;
Leaves lv; //it should have many leaves!! (and should be some pointer)
public:
add(Leave lv)
{
lv[lv_count] = lv;
lv_count ++ ;
}
}
class Tree
{
static br_count;
Branch br; //it should have many branchs!!! (and should be some pointer)
Tree
public:
add(Branch br)
{
br[br_count] = lv;
br_count ++ ;
}
}
this is for example, reaching a stupid approach:
class Branch
{
static count;
Leaves l[1000]; //mmm i don't like this
//...
}
class Tree
{
static count;
Branch b[1000]; //mmm i don't like this
//...
}
I would like to know the formal normal way for doing this, Thanks!!!!!!