C++基本语法5--C++程序设计教程/钱能主编--清华大学出版社

第十九章  IO流

类ofstream用于执行文件输出(向文件输入内容)

ofstream::ofstream(char * pFileName , int mode = ios::out,int prot = filebuf::openprot);

打开一个输入文件:

ifstream( const char* szName, int nMode = ios::in, int nProt = filebuf::openprot );

打开同时用于输入和输出的文件:

fstream( const char* szName, int nMode, int nProt = filebuf::openprot );

19.4  串流类

ostrstream用于执行串流输出。

ostrstream( char* pch, int nLength, int nMode = ios::out );

istrstream用于执行串流输入。

istrstream( char* psz );

istrstream( char* pch, int nLength );

strstream( char* pch, int nLength, int nMode );

19.5 控制符

manipulators是在头文件iomapip.h 中定义的。

19.6 使用IO成员函数

istream::getline

istream& getline( char* pch, int nCount, char delim = '/n' );

istream& getline( unsigned char* puch, int nCount, char delim = '/n' );

istream& getline( signed char* psch, int nCount, char delim = '/n' );

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值