basic_ios::eof

스트림의 끝에 도달 하는 경우를 나타냅니다.

bool eof( ) const;

반환 값

true스트림의 끝에 도달한 경우 false 그렇지.

설명

멤버 함수를 반환 합니다. true 경우 rdstate & eofbit 0이 아닙니다.eofbit에 대한 자세한 내용은 ios_base::iostate을 참조하십시오.

예제

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

using namespace std;

int main( int argc, char* argv[] ) 
{
   fstream   fs;
   int n = 1;
   fs.open( "basic_ios_eof.txt" );   // an empty file
   cout << boolalpha
   cout << fs.eof() << endl;
   fs >> n;   // Read the char in the file
   cout << fs.eof() << endl;
}

샘플 출력

false
true

요구 사항

헤더: <ios>

네임 스페이스: std

참고 항목

참조

basic_ios Class

iostream 프로그래밍

iostreams 규칙