Hi. Here is the question:
"Write a program to read strings into a vector. Now, copy that vector into an array of character pointers. For each element in the vector, allocate a new character array and copy the data from the vector element into that character array. Then insert a pointer to the character array into the array of character pointers."
Okay, the first part is easy but when it comes to the character array part I get very confused. I'd say I understand pointers but I don't seem to get this question. It says to insert a pointer to the new character array I create for each string element in the vector, but how can I insert a pointer into the original character array? I'm not asking for the full solution, I just need a little help by getting directed in the right path.
How can I make an array of character pointers...? So if I do manage to make this array, if I do:
It will output the array that was created for each string element? Help, please! :(Code:std::cout << Array[0] << std::endl;