当前位置:编程学习 > C/C++ >>

C++这句是啥意思?

fstream outfile;    outfile.open("f:flsdfj.txt",ios::app);
追问:C:\Users\Administrator\Desktop\9.4\新建文件夹\无法排序版.cpp(355) : error C2679: binary '<<' : no operator defined which takes a right-hand operand of type 'void' (or there is no acceptable conversion)
怎么个情况?fstream  outfile;
 outfile.open("备份数据.txt",ios::out);
啥意思?Outfile是对象吧?后面括号的是啥?
答案:以追加方式打开文本文件
f://flsdfj.txt  文件路径
ios::app  打开方式
fstream  outfile  声明一个文件流的对象outfile
其他:打开文件 "f:flsdfj.txt" (目测有错误,应该 f:\\flsdfj.txt)
以追加方式, 打开 以追加的方式打开f:flsdfj.txt outfile是fstream类(流文件类);outfile.open("f:flsdfj.txt",ios::app)调用其成员函数,表示打开TXT文件 打开文件

上一个:C语言编程题:1至4个for语句循环的例题,并注释意义,望高手回答
下一个:C++scanf怎么用?

CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,