>>I need to know which part do I assign to the pointer to childform.
Unless this is a school assignment where you have to roll your own list, it's easier and faster and safer to use C++'s list class
Code:
#include <list>
using namespace std;
int main()
{
list<TChildForm *> myList;
}
Then you can treat it like a vector that's safe to insert anywhere. :-) If you have to roll your own then this is a good start
Code:
struct node {
explicit node(TChildForm *content, node *link): form(content), next(link)
{}
TChildForm *form;
node *next;
};
int main()
{
node *head = 0;
for (int i = 0; i < 10; i++) // Or some kind of loop
{
node *np = new node(new TChildForm(), head);
head = np;
}
// Work with the list then free it
}