在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 教程/ C++/ fstream::rdbuf()函數(shù)
std::put_money()函數(shù)
std::setprecision()函數(shù)
std::get_time()函數(shù)
basic_ios::openmode
basic_ios::basic_ios構(gòu)造函數(shù)
ios::rdstate()函數(shù)
ios::good()函數(shù)
C++ <fstream>
fstream::swap()函數(shù)
ios非運(yùn)算符
ostream運(yùn)算符=
std::resetiosflags()函數(shù)
ios::move()函數(shù)
ios::clear()函數(shù)
std::fpos()函數(shù)
ios::narrow()函數(shù)
fstream::close()函數(shù)
ios::imbue()函數(shù)
basic_ios::setstate
ios_base::fmtflags
C++ <iomanip>
std::setw()函數(shù)
ios_base::failure
C++ <basic_ios>
ios::fill()函數(shù)
ios_base::Init
ios::widen()函數(shù)
ios庫(kù)<ios>
std::setbases()函數(shù)
ios::swap()函數(shù)
ios::set_rdbuf()函數(shù)
std::setiosflags()函數(shù)
std::put_time()函數(shù)
std::get_money()函數(shù)
ios_base::seekdir
ios_base::event_callback()函數(shù)
fstream::rdbuf()函數(shù)
std::setfill()函數(shù)
fstream::isopen()函數(shù)
ios::tie()函數(shù)
ios::copyfmt()函數(shù)
fstream::open()函數(shù)
basic_ios::basic_ios析構(gòu)函數(shù)
ios_event::eof()函數(shù)
io::rdbuf()函數(shù)
ios::exceptions()函數(shù)
ios::init()函數(shù)
ios_base::event()函數(shù)
C++標(biāo)準(zhǔn)庫(kù)教程

fstream::rdbuf()函數(shù)

它返回一個(gè)指向內(nèi)部filebuf對(duì)象的指針。

聲明

下面是fstream::rduf()函數(shù)的聲明。

C++11

filebuf* rdbuf() const;

返回值

它返回一個(gè)指向內(nèi)部 filebuf 對(duì)象的指針。

示例

在下面的例子中解釋了 fstream::rdbuf() 函數(shù)。

#include <fstream>
#include <cstdio>

int main () {
   std::fstream src,dest;
   src.open ("test.txt");
   dest.open ("copy.txt");

   std::filebuf* inbuf  = src.rdbuf();
   std::filebuf* outbuf = dest.rdbuf();

   char c = inbuf->sbumpc();
   while (c != EOF) {
      outbuf->sputc (c);
      c = inbuf->sbumpc();
   }

   dest.close();
   src.close();

   return 0;
}