basic_ofstream::open

打开文件。

void open(
    const char *_Filename,
    ios_base::openmode _Mode = ios_base::out,
    int _Prot = (int)ios_base::_Openprot
);
void open(
    const char *_Filename,
    ios_base::openmode _Mode
);
void open(
    const wchar_t *_Filename,
    ios_base::openmode _Mode = ios_base::out,
    int _Prot = (int)ios_base::_Openprot
);
void open(
    const wchar_t *_Filename,
    ios_base::openmode _Mode
);

参数

备注

成员函数调用 rdbuf打开( ->_Filename,_Mode |ios_base::out). 如果该函数返回 null 指针,函数调用 setstate(failbit)。

示例

对于使用 打开的示例参见 basic_filebuf::open

要求

页眉: <fstream>

命名空间: std

请参见

参考

basic_ofstream 类

iostream 编程

iostreams 约定