If fseek() always clears EOF, is there a way for me to fread() from anoffset of a file and still be able to detect EOF?i.e. withouting usingfseek(). I also need to seek to an offset in the filefrequently(forwards and backwards) and do fread() from that offset.Or better still, could anyone let me know some good ways to achievewhat I need to do as above?Can I get hold of the file and being ableto read in without using fread()? Using memory addresses?Thanks 解决方案Please explain how the several previous answers to your severalprevious similar questions are inadequate.--"A lesson for us all: Even in trivia there are traps."--Eric SosmanPlease explain how the several previous answers to your severalprevious similar questions are inadequate.--"A lesson for us all: Even in trivia there are traps."--Eric SosmanI still don''t know how can I detect EOF while I''m always use fseek()(It always clears EOF), and I must be able to seek forwards andbackwards in the file, but I still don''t know up to now how can I dothis without fseek(), that''s why I posted this question. Please explain how the several previous answers to your severalprevious similar questions are inadequate.I still don''t know how can I detect EOF while I''m always use fseek()(It always clears EOF), and I must be able to seek forwards andbackwards in the file, but I still don''t know up to now how can I dothis without fseek(), that''s why I posted this question.After fseek(), call fread() to read data. If it returns a shortread, you have either encountered an error or end of file. Useferror() and feof() to distinguish an error from end of file.This is what I said last time. How is it inadequate?--Ben Pfaff bl*@cs.stanford.edu http://benpfaff.org 这篇关于feof(),fseek(),fread()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
09-05 17:02
查看更多