ofstream的使用方法

来源:互联网 发布:大庆三打一网络直播 编辑:程序博客网 时间:2024/05/16 15:05


ofstream是从内存到硬盘

 ifstream是从硬盘到内存

fstream有两个子类:ifstream(input file stream)ofstream(outpu file stream)ifstream默认以输入方式打开文档,而ofstream默认以输出方式打开文档。

ifstream file2(/"c:////pdos.def/");//以输入方式打开文档

ofstream file3(/"c:////x.123/");//以输出方式打开文档


假如想以输入方式打开,就用ifstream来定义;假如想以输出方式打开,就用ofstream来定义;假如想以输入/输出方式来打开,就用fstream来定义。

i   input

o  output

f  file

Fr: http://blog.sina.com.cn/s/blog_66474b160100wgan.html



原创粉丝点击