Returns an integer that represents the next character read from
at the end-of-stream or when an error occurs.
is identical to
and is included only as a convenience for those accustomed to using
one or the other when writing C programs.
The simple program,
copies standard input to standard output one character at a time,
so it is slow.
There is another way to do exactly the same thing that is a bit faster
because it avoids the overhead involved in calling built-ins.
while ((ch = getc(stdin)) != -1)
and you will copy standard input to standard output one character at a time.
You will find more details in our discussion of the
while ((ch = stdin.nextchar) != -1)
stdout.nextchar = ch;
| See Also:
Yoix is a registered trademark of AT&T Inc.