文字列クラスへのポインターの配列があり、ファイルから各ポインターに行をコピーする必要がありますが、その方法がわかりません。
void Document::loadFile(string iFileExt){
ioFile = new fstream(iFileExt.c_str(), ios::in);
int i = 0;
string row;
string *content;
if (ioFile->fail()){
cerr << "File failed to open for read" << endl;
exit(69);
}
while(ioFile->good()){ // this loop is just to know how may rows are in the file
getline (*ioFile, row);
i++;
}
content = new string[i]; // I allocate memory dynamically so that the numbers of
ioFile->seekg(0); // pointer is the same as the number of rows
i = 0;
while(ioFile->good()){
getline (*ioFile, *content[i]); //this is the tricky part
i++;
}
ioFile->close();
}
あなたが私に提供できる助けやヒントを事前にありがとう! :-)