在线文档教程
C++
输入/输出 | Input/output

std::basic_ofstream::close

性病:基本[医]流::关闭

void close(

关闭关联文件。

有效呼叫rdbuf()->close()如果操作过程中发生错误,setstate(failbit)叫做。

参数

%280%29

返回值

%280%29

注记

此函数由Basic的析构函数调用。[医]当流对象超出作用域时,通常不会直接调用。

另见

is_openchecks if the stream has an associated file (public member function)
openopens a file and associates it with the stream (public member function)
closeflushes the put area buffer and closes the associated file (public member function of std::basic_filebuf)

© cppreference.com

在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。

http://en.cppreference.com/w/cpp/io/basic[医]流/关闭