This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Problem with fread


Hi All
 
We are using fread to read the entire contents of the file in a buffer.

Does fread append "\0" at the end of the buffer or we have to do it
manually?
 
Attached is a sample program. We are using the test function twice. Second time when we call the fucntion, give file has a smaller size then what was given at the first call.
 
Second time, output is gargled towards end.
 
any idea???
 
Regds
Ajay Bansal
 

Attachment: test_fread.cpp
Description: test_fread.cpp


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]