I'm quite new to programming but I've looked all over the web and cant find anything that answers my question, so now I'm trying this, hope you can help!
So, I'm trying to create a class that has many variables and many functions to access them, plus a few more to use the data. I made this test program to see whether I had the object oriented concepts down. Apparently, I dont. I've gotten the object array to work, but the most important part doesn't work. That is, when I use parentobject->function() the function only gets called to the parent object and not all its children, which is what I want. Is there some TObjArray library or other way of doing this that would be easier. I'm trying to avoid using a for loop every time I want to call a function to each child object (that would slow things down greatly). I'd like to be able to call uniform functions to each object with one line of code. Here's an example of what I'm working with. Thanks in advance for any help.
const int TOTAL=40;
void SetCapacity(int StartCapacity);
TDot *Population = new TDot;
for (int i=0;i<NumStartDots;i++)
Population->D[i] = new TDot;
void TDot::SetCapacity(int StartCapacity)