Topic: C++ - fread(...) problem
Author: greg@silver.usbm.gov (Greg Cole)
Date: 6 Dec 1994 18:51:14 GMT Raw View
Greetings all,
I am writing a little program using the borland c++ 3.1 dos compiler.
It reads data from a binary file then scales and plots it to the screen.
Problem:
If I fread in 8192 items of size 2 into a pre-declared array of
int buff[8192], the program crashes. If I up the array to int buffer[10193]
it works ok. Still only fread'ing 8192.
If I keep buffer at 8192 but fread in only 2 bytes at a time
the program also functions.
What is it with fread that does this? Is it curable? The whole idea
was to take large bites and limit disk drive load.
Any info appreciated.
<greg@silver.usbm.gov>___________________is_____________________<Greg Cole>
Standard Disclaimers Apply. Inc. - "We've been applied all over the world."