Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
可能重复: fread/fwrite 将大小和计数作为参数的理由是什么?
在 C 语言中,fwrite 和 fread 获取要写入的元素数量和每个元素的大小。似乎只有一个参数来告诉应该写入的字节数会更明显和更通用,因为要写入的字节数简单地等于元素乘以大小。设计这些功能是有充分的理由,还是古代失传了?