SourcePoint AMD Help

Table of Contents

fgetc

Read a character from a file.

Syntax

[result =] fgetc(file_handle)

Where:

result

specifies a debug variable of type int4 to which the function return value is assigned. If result is not specified, the return value is displayed on the next line of the screen.

file_handle

is the file handle returned from a previous fopen command

Discussion

The fgetc function reads a character from a file previously opened by fopen. A -1 is returned upon reading end of file.

Example

Command input:

define ord4 file1
file1 = fopen("test.dat","w")
fputc('A',file1)
fclose(file1)
file1 = fopen("test.dat","r")
fgetc(file1)

Result:

00000041H

Related Topics: