note1: that when i run the code, the line cout << treeVector.back()->getName(); works, the problem is in the for loop.
note2: when i run the code with only the following code in the for loop cout << *it<< endl;, i get the following output
w
LISTING
0
0x99260f8
0x99260a8
0x9926108
0
0x99260f8
0x99260a8
i think this means that there are pointers that dont point to any memory
the weird thing is that when the objects are made, all the pointers do point to some memory and that position 4 and 0 allways become 0
this is the output when the pointers are made
Notice that you added 7 TreeElements all with unique addresses but you only have 3 valid addresses printing out in Treeprint?
What happen to the other 4? One was turned into 0 (NULL) the others are gone.