ofstream, 类似 ostream, 有一个指针 put pointer ,指向写入下一个元素的位置。 fstream, 类似 iostream, 同时继承了get 和 put 我们可以通过使用以下成员函数来读出或配置这些指向流中读写位置的流指针: tellg() 和 tellp() 这两个成员函数不用传入参数,返回pos_type 类型的值(根据ANSI-C++ 标准) ,就是一个...
std::basic_ostream::put std::basic_ostream::seekp std::basic_ostream::sentry std::basic_ostream::swap std::basic_ostream::tellp std::basic_ostream::write std::basic_ostringstream std::basic_ostringstream::basic_ostringstream std::basic_ostringstream::rdbuf std::basic_ostringstream::str std::...
第一个函数 (write) 是ostream 的一个成员函数,都是被ofstream所继承。而read 是istream 的一个成员函数,被ifstream 所继承。类 fstream 的对象同时拥有这两个函数。它们的原型是: write ( char * buffer, streamsize size );read ( char * buffer, streamsize size ); 这里buffer 是一块内存的地址,用来...