f_getc


Use this function to read a character from the current position in the open target file.

Format

int f_getc ( F_FILE * filehandle )

Arguments

Argument Description Type
filehandle The handle of the open target file. F_FILE *

Return values

Return value Description
-1 Operation failed.
value The character read from the file.

Example

int myreadfunc( char *filename, char *buffer, long buffsize ) 
{
    int ch;
    F_FILE *file = f_open( filename, "r" );
    while ((ch = f_getc( file )) != -1)
    {
        if (!buffsize) break;
        *buffer++ = ch;
        buffsize--;
    }
    f_close( file );
    return 0;
}