C++中的流对象

1.I/O类库中常用的流类:
基类
ios  
istream :ios
ostream :ios
iostream :istream,ostream

文件流
ifstream :istream
ofstream :ostream
fstream :iostream

字符流
istrstream  
ostrstream
strstream

2.用到的头文件:
iostream 基本输入输出流
fstream 文件流使用
strstream   字符串流使用
stdiostream 混用c和c++中的I/O流使用
iomanip 格式化流使用

3.标准输出流:cout,cerr,clog


3.1。格式输出:可以使用流对象的成员函数来格式化

使用控制符:如dec,hex,setw,setionsflags(ios::fixed)


4.标准输入流cin,

cin.get,cin.getline


5.文件流:
文件流打开,
ofstrem outfile;
outfile.open("f1.dat",ios::out);
关闭流,outfile.close();


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值