I Have a similar issue like the one listed here pointer-to-a-pointer-to-a-struct-giving-headache
my issue is different because i don't want multi instances from LISTOFONES i want Multi instances of ONE's Pointers like
class ONE {
int id;
char *name;
};
class LISTOFONES {
ONE **pointers;
char *name;
LISTOFONES ();
~LISTOFONES ();
};
What to do to have a correct and memory safe initialization of the pointers variable with
1- pure c++ .. not stl containers
2- 100% dynamic not [] array limitation
3- Completely Memory Safe ( All Pointers safely point to a valid class too )
EDIT:
This is Not Home Work
and For what i want i only want to know what is the method to correctly init the pointers in the 'pointers' variable
EDIT
I Am trying to Achieve a Pointer List (array) Pointed by the Pointer pointers
Each Pointer points to the ONE struct
LISTOFONES::pointersto be aONE**rather than aONE*. What are you trying to achieve here?