getc() vs fgetc - What are the major differences?
Everywhere I see "it is practically identical", or something similar...
From The GNU C Programming Tutorial :
There is another function in the GNU C Library called fgetc. It is
identical to getc in most respects, except that getc is usually
implemented as a macro function and is highly optimised, so is preferable
in most situations. (In situations where you are reading from standard
input, getc is about as fast as fgetc, since humans type slowly compared
to how fast computers can read their input, but when you are reading from
a stream that is not interactively produced by a human, fgetc is probably
better.)
What are the other differences? I have heard that they each have a
different implementation (and one can be used as a macro) but, what makes
them soo different (or different enough) for them to be both to be in the
Standard C library (or specification)?
No comments:
Post a Comment