Mail Archives: djgpp/1997/06/20/20:24:57
Chris wrote:
> What I am doing is reading in numbers as shorts and need a function
> that can do that with a binary file and stop at the EOF. How is this
> best accomplished.
I'm surprised this question is asked so often, since every C book I've
seen goes over this point in detail.
If you want to open a file in binary, then you need to open it as such.
You do this by using mode "rb" in the call to fopen:
file = fopen(filename, "rb");
--
Erik Max Francis, &tSftDotIotE / email / max AT alcyone DOT com
Alcyone Systems / web / http://www.alcyone.com/max/
San Jose, California, United States / icbm / 37 20 07 N 121 53 38 W
\
"Covenants without the sword / are but words."
/ Camden
- Raw text -