I'm having a problem filling a vector with strings read as lines from a file. My vector has been declared:
vector <char*> stringVector;
and I can fill it fine with
and so on...
However when I read from a file:
The vector is not filled properly, it's length is increased but the elements do not become what tempString contains. I know tempString is getting the lines of the file because I debugged using
cout << tempString;
I also thought about setting the first element of tempString to a null terminator after each time it's been pushed onto the vector, this has no effect.
Please can someone help, it's driving me mad!