BL> I don't understand why fread() is faster than getc(). How do they
BL> get the file data into the buffer? Don't you have to move it one
BL> character at a time?
RM> yes, but getc() does it with a call to a C function for *each*
RM> character, instead of reading a bunch of chars with just one
RM> function call.
Actually, getc() is normally a macro. fgetc() does the function call.
RM> I learned this the hard way with output - it's a lot faster to
RM> write a whole string to the screen than it is to write the string
RM> one char at a time.
Sure. BFN. Paul.
@EOT:
---
* Origin: X (3:711/934.9)
|