ping@cubmol.BIO.COLUMBIA.EDU (Shiping Zhang) (08/20/89)
In article <2800@wasatch.utah.edu> u-tholly@wasatch.utah.edu (Troy Holly) writes: >I used fwrite() to write an array and the length of the array to disk. When >I used fread() to read the same data, only the first element of the array and >the integer representing the length had the right value. The code was >compiled with Microsoft C 5.1, and looks something like this: >What am I doing wrong? [......] >Troy One thing I can see immediately to be wrong is the way malloc() is used. malloc() returns a point to char. To assign it to a point to float, proper casting must be made. -ping