Home
Search all pages
Subjects
By activity
Professions, Sciences, Humanities, Business, ...
User Interface
Text-based, GUI, Audio, Video, Keyboards, Mouse, Images,...
Text Strings
Conversions, tests, processing, manipulation,...
Math
Integer, Floating point, Matrix, Statistics, Boolean, ...
Processing
Algorithms, Memory, Process control, Debugging, ...
Stored Data
Data storage, Integrity, Encryption, Compression, ...
Communications
Networks, protocols, Interprocess, Remote, Client Server, ...
Hard World Timing, Calendar and Clock, Audio, Video, Printer, Controls...
File System
Management, Filtering, File & Directory access, Viewers, ...
|
|
|
RocketLink!--> Man page versions:
OpenBSD
FreeBSD
Others
[ANSI C X3.159-1989]
GETC(3) OpenBSD Programmer's Manual GETC(3)
NAME
fgetc, getc, getchar, getw - get next character or word from input stream
SYNOPSIS
#include <stdio.h>
int
fgetc(FILE *stream);
int
getc(FILE *stream);
int
getchar(void);
int
getw(FILE *stream);
DESCRIPTION
The fgetc() function obtains the next input character (if present) from
the stream pointed at by stream, or the next character pushed back on the
stream via ungetc.
The getc() function acts essentially identically to fgetc(), but is a
macro that expands in-line.
The getchar() function is equivalent to getc() with the argument stdin.
The getw() function obtains the next int (if present) from the stream
pointed at by stream.
RETURN VALUES
If successful, these routines return the next requested object from the
stream. If the stream is at end-of-file or a read error occurs, the rou-
tines return EOF. The routines feof(3) and ferror(3) must be used to dis-
tinguish between end-of-file and error. If an error occurs, the global
variable errno is set to indicate the error. The end-of-file condition
is remembered, even on a terminal, and all subsequent attempts to read
will return EOF until the condition is cleared with clearerr.
SEE ALSO
ferror(3), fopen(3), fread(3), putc(3), ungetc(3)
STANDARDS
The fgetc(), getc() and getchar() functions conform to ANSI X3.159-1989
(``ANSI C'').
BUGS
Since EOF is a valid integer value, feof and ferror must be used to check
for failure after calling getw(). The size and byte order of an int
varies from one machine to another, and getw() is not recommended for
portable applications.
OpenBSD 2.6 June 4, 1993 1
Source: OpenBSD 2.6 man pages. Copyright: Portions are copyrighted by BERKELEY SOFTWARE DESIGN, INC., The Regents of the University of California, Massachusetts Institute of Technology, Free Software Foundation, FreeBSD Inc., and others. |
(Corrections, notes, and links courtesy of RocketAware.com)
FreeBSD Sources for getc(3) functions OpenBSD sources for getc(3)
Up to: Stdio Stream file operations - Buffered access of files and devices. fopen, fputc, fgetc, et al.
RocketLink!--> Man page versions:
OpenBSD
FreeBSD
Others
[ANSI C X3.159-1989]
Rapid-Links:
Search | About | Comments | Submit Path: RocketAware > man pages >
getc.3/
RocketAware.com is a service of Mib Software Copyright 1999, Forrest J. Cavalier III. All Rights Reserved. We welcome submissions and comments
|