i need an array of strings to hold lines of a text file but i don't know how many lines i will have.
normally i would just need something like string lines[]; or vector<string> lines; but that's not working.
if thats not possible i could make a huge number of lines and define it to a certain value so i could check how much lines i have. something like string lines[10000] = "a"; but even that is not working.
could somebody help me?
getline(myfile,templine); // declare 'templine' as string (instead of char buffer [10000], this will take lines of any length
lines.push_back(templine); // insert an element to the vector with the value of 'templine'