Fastest file reading in C

前端 未结 7 1442
耶瑟儿~
耶瑟儿~ 2020-12-05 00:50

Right now I am using fread() to read a file, but in other language fread() is inefficient i\'v been told. Is this the same in C? If so, how would faster file reading be done

7条回答
  •  再見小時候
    2020-12-05 01:43

    If you are willing to go beyond the C spec into OS specific code, memory mapping is generally considered the most efficient way.

    For Posix, check out mmap and for Windows check out OpenFileMapping

提交回复
热议问题