basic_filebuf::is_open

파일이 열려 있는지 여부를 나타냅니다.

bool is_open( ) const;

반환 값

true 이면 파일 포인터는 null 포인터가 아닌 경우.

예제

// basic_filebuf_is_open.cpp
// compile with: /EHsc
#include <fstream>
#include <iostream>

int main( ) 
{
   using namespace std;
   ifstream file;
   cout << boolalpha << file.rdbuf( )->is_open( ) << endl;

   file.open( "basic_filebuf_is_open.cpp" );
   cout << file.rdbuf( )->is_open( ) << endl;
}
  

요구 사항

헤더: <fstream>

네임 스페이스: std

참고 항목

참조

basic_filebuf Class

iostream 프로그래밍

iostreams 규칙