BL> It seems to run a bit faster than fread() with a 128-byte
BL> buffer. I thought they might have a trick.
BL> I meant it's a bit faster the other way around. fgets()/fputs() is
BL> faster. If I read/write a file using fread()/write() with a 128-byte
BL> buffer and then do fgets(s, 128, *file) then fgets() is a little
BL> faster.
fgets() would be faster after fread() if the fread() had just loaded a
512-byte buffer for you, and now your fgets is just reading out of the
buffer, instead of the fgets() having to do both.
BL> I didn't try it. Why would it be any different to fgetc()? It's
BL> much
PE> It's a macro instead of a function call.
BL> Doesn't that mean it just calls another function?
No. It can, but normally getc() is implemented by a 6-line macro which
just accesses a the buffer directly.
PE> Which is actually what both fgetc() and getc() do, sort of.
BL> What's a one-byte buffer called?
Pass. Who's using a 1-byte buffer? BFN. Paul.
@EOT:
---
* Origin: X (3:711/934.9)
|