.FEof()

back to FEHSD

Description

This function is used to detect if the end of file has been reached.

Syntax

.FEof(FEHFile *fptr);

Parameters

fptr: Pointer to FEHFile to check for EOF

Returns

A non-zero valued int if the FEHFile pointer has reached end of the file; otherwise it returns a zero.

Examples

#include <FEHSD.h>

int main(void)
{
    int nums[100], i = 0;
    //Open new file for writing
    FEHFile *fptr = SD.FOpen(“Test.txt”,”r”);
    //Loop until end-of-file is reached and read in numbers for array
    while(!SD.FEof(fptr)){
        SD.FScanf(fptr, “%i”, &nums[i]);
        i++
    }
    //Close the file
    SD.FClose(fptr); 
}