need of fseek() in c

ⅰ亾dé卋堺 提交于 2019-12-01 12:05:37

The use of fseek() here - The C standard requires a positioning operation between a read and a write operation on an update stream, or between a write and a read. This is a positioning operation between a write and a read. It is not a no-op; it places the stream into a mode which allows the next fgetc() to work correctly, reliably, across platforms, as required by the C standard.

EDIT:

2 fseek() calls are required because the first one acts as the "no-op" call between an fgetc() and a subsequent fputc() call. After the fputc(), the second one acts as the "no-op" between the fputc() and the subsequent fgetc() call. (since a loop is running)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!