如果是输入输出流(同时支持输入和输出),可能都可以。 [解决办法] seekg : Input file streams keep an internal pointer to the position in the file where data is to be read next. You set this pointer with the seekg function, as shown here: ------------------ The seekp Functions An output file stream keeps an internal pointer that points to the position where data is to be written next. The seekp member function sets this pointer and thus provides random-access disk file output. The tellp member function returns the file position. For examples that use the input stream equivalants to seekp and tellp, see The seekg and tellg Functions.