LabWindows/CVI

Content Type
Programming Language
Current manual
Table of Contents

fgetc

fgetc

int fgetc (FILE *stream);

Purpose

Reads the next character from the specified input stream and advances the associated file position indicator. If successful, the function will return the character read; otherwise, the value EOF (-1) is returned.

Parameters

Input
Name Type Description
stream FILE * Contains a pointer to the input stream from which a character is read.

Return Value

Name Type Description
characterRead int Contains the next character read from the input stream pointed to by stream. Two cases cause the function to return EOF (-1):
  • Read Error—Error indicator for stream is set
  • Stream at end-of-file—EOF indicator for stream is set
If an error occurs, fgetc returns EOF and sets errno to a nonzero value.

Additional Information

Library: ANSI C Library

Include file: ansi_c.h

LabWindows/CVI compatibility: LabWindows/CVI 3.0 and later

Example

Refer to dotnet\Timer\timer.cws for an example of using the fgetc function.

Was this information helpful?

Previous

getchar

Next

getc

Previous

getchar

Next

getc