**Array of *arrays

I am trying to make a **array that holds a char*array and was wondering how I would do that. I wanted to do something like child **parent=new child*[10]; but that isn't possible. The problem is I can't use the STL (no strings, no vectors) and that means array of char. But that is hard cause I have no idea how you create a unique instance of every child char. If you do something like
parent[0]=child;
parent[1]=child;
etc...
then all that happens is every instance of parent[x] becomes the most recent child since they are all pointing to child. But what can you do with child when it has to be a dynamically allocated array to save on wasted memory. Even if you didn't dynamically allocate you would still have to come up with a way to create a unique instance of child. Any advice would be great, thanks!
I wanted to do something like child **parent=new child*[10]; but that isn't possible


I have not understood why is it impossible?!
1
2
3
4
5
6
char **parent = new char*[NUM_STRINGS];

for(size_t i = 0; i < NUM_STRINGS; ++i)
{
     parent[i] = new char[10];
}

The question is why can't you use vectors and strings? This is exactly what they were created for.
Topic archived. No new replies allowed.