Что такое feof stdin

от admin

Функция feof

Функция feof проверяет, достигнут ли конец файла, связанного с потоком, через параметр filestream . Возвращается значение, отличное от нуля, если конец файла был действительно достигнут.
Вызов данной функции, как правило, выполняется после выполнения предыдущей операции с потоком, например операции считывания, которая постепенно двигает внутренний указатель файла в конец.
Дальнейшие операции с файлом, после достижения его конца не будут выполняться до тех пор, пока внутренний указатель не будет сдвинут назад, функциями fseek или fsetpos . Таким образом индикатор положения внутреннего указателя будет иметь новое значение, отличное от EOF .

Параметры:

  • filestream
    Указатель на объект типа FILE , идентифицируемый поток.

Возвращаемое значение

Если достигнут конец файла, функция возвращает ненулевое значение.
В противном случае возвращается нулевое значение.

Что такое feof stdin

feof — функция стандартной библиотеки языка Си, объявленная в заголовочном файле stdio.h. Ее основное назначение — отличать случаи, когда операции потока достигают конца файла, от случаев, когда возвращается код ошибки EOF («конец файла», от англ. «end of file») в качестве индикатора основной ошибки без действительного достижения конца файла.

Содержание

Прототип функции

Функция объявляется следующим способом:

Она принимает один аргумент: указатель на структуру FILE потока для проверки.

Возвращаемое значение

Возвращаемое значение функции является числом целого типа. Ненулевое значение означает, что конец файла достигнут; значение, равное нулю, свидетельствует о том, что не достигнут.

Пример кода

Ссылки

  • feof  — системные интерфейсы, The Single UNIX® Specification, выпуск 7 от The Open Group (англ.) , Эрик Сосман написал в Usenet-группу comp.lang.c, 10 Jul 2006 вопросов и ответов по языку Си.

Wikimedia Foundation . 2010 .

Полезное

Смотреть что такое «Feof» в других словарях:

Feof — is a C standard library function declared in the header stdio.h. Its primary purpose is to distinguish between cases where a stream operation has reached the end of a file and cases where the EOF ( end of file ) error code has been returned as a… … Wikipedia

feof — feof·for; … English syllables

feof|fer — «FEHF uhr, FEE fuhr», noun. a person who grants a fief or fee … Useful english dictionary

feof|for — «FEHF uhr, FEE fuhr», noun. = feoffer. (Cf. ↑feoffer) … Useful english dictionary

feoffor — feof·for (fĕfʹər, fēʹfər) n. Variant of feoffer. * * * … Universalium

feoffor — feof·for … English syllables

EOF — Saltar a navegación, búsqueda EOF (abreviatura de end of file, fin de fichero en inglés) es un indicador o marca de que no hay más información que recuperar de una fuente de datos. La fuente de datos puede ser un fichero o un flujo de datos… … Wikipedia Español

Читать:
Ext moextended что значит

Файловый ввод/вывод в языке Си — Язык программирования Си поддерживает множество функций стандартных библиотек для файлового ввода и вывода. Эти функции составляют основу заголовочного файла стандартной библиотеки языка Си <потоками байтов, которые могут быть как потоками… … Википедия

Feoffee — Feof*fee (?; 277), n. [OF. feoff[ e].] (Law) The person to whom a feoffment is made; the person enfeoffed. [1913 Webster] … The Collaborative International Dictionary of English

Feoffer — Feofor Feo for, Feoffer Feof fer, n. [OF. feoour.] (Law) One who enfeoffs or grants a fee. [1913 Webster] … The Collaborative International Dictionary of English

std:: feof

Checks if the end of the given file stream has been reached.

Contents

[edit] Parameters

stream the file stream to check

[edit] Return value

Nonzero value if the end of the stream has been reached, otherwise ​ 0 ​ .

[edit] Notes

This function only reports the stream state as reported by the most recent I/O operation, it does not examine the associated data source. For example, if the most recent I/O was a std::fgetc , which returned the last byte of a file, std::feof returns zero. The next std::fgetc fails and changes the stream state to end-of-file. Only then std::feof returns non-zero.

In typical usage, input stream processing stops on any error; feof and std::ferror are then used to distinguish between different error conditions.

Что такое feof stdin

Checks whether the end-of-File indicator associated with stream is set, returning a value different from zero if it is.

This indicator is generally set by a previous operation on the stream that attempted to read at or past the end-of-file.

Notice that stream‘s internal position indicator may point to the end-of-file for the next operation, but still, the end-of-file indicator may not be set until an operation attempts to read at that point.

This indicator is cleared by a call to clearerr, rewind, fseek, fsetpos or freopen. Although if the position indicator is not repositioned by such a call, the next i/o operation is likely to set the indicator again.

Похожие статьи