basic.%fgetc

C Function/BASIC Program, Releases: AP/Unix

Gets a character from a stream.

Syntax

variable=%fgetc( (char*)stream )

Description

returns the next character from the named input 'stream'.

Note that the character is returned as a number. Normal usage would override the type (see example below). The Unix 'getc()' and 'getchar()' cannot be used because they are macros, rather than functions.

Example

c=(char)%fgetc( (char*)strm )
crt c

Note the character type casting to override the default (int) type.

See Also

Command Name Type Description
basic.cfunc Definition can be called from a Pick/BASIC program or subroutine in AP/DOS and AP/Unix implementations using a syntax similar to that of normal C.
basic.cfunction Definition Declare a list of C functions.
basic.%fopen C Function Opens a stream.
basic.%fclose C Function Closes stream.
basic.%fgets C Function Reads a C string from a stream.
basic.%fputs C Function Writes a string on a stream.

User Comments

What do you think?

Share your experience or ask a question by using the form below.

Login to leave your comments.