以下が機能していないように見えることにかなり動揺しています。
while(myfile.good())
{
myfile.get(holdc);
....................
}
//does not work
myfile.seekg(0);
myfile.read(buffer,5);
sentence.push_back(buffer);
cout << buffer<<endl;
delete[] buffer;
私は myfile.close などを試しましたがifstream myfile2;
、ファイルをリロードするために新しいものを作成しました。何も機能しません。あたかもこのシークが普遍的か何かであるかのようであり、プログラムごとに 1 回しか機能しません。