Using fstream::seekg under windows on a file created under Unix
问题 I have C++ a cross-platform program (compiled with g++ under Linux and with Visual Studio under PC). This program writes lines to a text file (using << operator and std::endl ) but can also read data back from the generated text file (using std::getline ). To optimize data access and save memory, when reading the data file, I read it a first time and save data position in my program. When data is needed, I later use seekg to move to a specific position and read the data. Creating and reading