954,499 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article
Ahzraei
Newbie Poster
2 posts since Jan 2006
Reputation Points: 10
Solved Threads: 0
 

Apologies, minor error in the code. Problem still outstanding.

class A
{
     A() {}

     void AddChild(A* child)
     {
           m_aryChildren.Add(child);
     }

     CArray<A*> m_aryChildren;
}

class B : public A
{
      B()
      {
            A::AddChild(new A());
      }
}

// ....

A aobject;
aobject.AddChild(new B());
int size = aobject[0].m_aryChildren.GetSize();
Ahzraei
Newbie Poster
2 posts since Jan 2006
Reputation Points: 10
Solved Threads: 0
 

[edit]I deleted my comment[/edit]

Ancient Dragon
Retired & Loving It
Team Colleague
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You