您当前的位置: 首页 >  c++

txwtech

暂无认证

  • 3浏览

    0关注

    813博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

ca76a_c++_流文件打开输入输出文件模式

txwtech 发布时间:2020-02-11 20:54:41 ,浏览量:3

/*ca76a_c++_流文件打开输入输出文件模式 利用文件流打开文件进行输入与输出时的选项 in、out、app(附加模式)、ate((end)文件打开后,定于文件结尾)、trunc(裁剪)、binary(二进制)、、、、、 文件模式组合 out out|app out|trunc in in|out int|out|ate int|out|trunc

welcome to discuss txwtech@163.com */

/*ca76a_c++_流文件打开输入输出文件模式
利用文件流打开文件进行输入与输出时的选项
in、out、app(附加模式)、ate((end)文件打开后,定于文件结尾)、trunc(裁剪)、binary(二进制)、、、、、
文件模式组合
out
out|app
out|trunc
in
in|out
int|out|ate
int|out|trunc

welcome to discuss
txwtech@163.com
*/
#include 
#include 
#include 

using namespace std;

int main()
{
	//ifstream读取文件内容
	string s;
	ifstream ifs("file1.txt",ifstream::in);//不写就是默认的文件模式in打开
	//先判断,是否打开成功
	if (!ifs)
	{
		cerr             
关注
打赏
1665060526
查看更多评论
0.0810s