getc() vs fgetc() - What are the major differences?

前端 未结 3 637
慢半拍i
慢半拍i 2020-12-23 13:33

Everywhere I see \"it is practically identical\", or something similar...

From The GNU C Programming Tutorial :

There is another function in t

3条回答
  •  攒了一身酷
    2020-12-23 14:06

    There are essentially the same (or similar enough to not bother). You should look at their implementation: GNU libc and MUSL libc are free software implementations. And they now could be implemented as inline functions (which are as fast as macros).

    And I won't bother that much. In real life, I/O is mostly constrained by hardware (e.g. the time to access the disk).

提交回复
热议问题