I am trying to create a dynamic string array in C++ that will read in words from a file. The length of the words and how many words will belong in the array is unknown.
In the class XYZ, there is the following var char *str;
This isnt working. I know that char *tmp will let me store a word of any length (of course with the use of new) but if I want to make an array of words, I cant do it.Code:XYZ obj; ifstream in; ..... ..... while (!in.eof()) in >> obj.str[i++]>> ws;