Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Reply-To: From: "GI-HYEON PARK" To: Subject: fread help! Date: Thu, 9 Aug 2001 11:42:31 -0700 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700 Importance: Normal Hi, I am trying to read binary file in WIN ME and it does not read data correctly. I tried the same code in solaris and it works fine.. Does anybody know why C program in WIN ME reads data wrong? Thanks.. Here is my code.. #include #include #include "MATRIX.h" #include "MATRIX.c" #include "SetValue.h" #include "SetValue.c" int main(void) { char data[200]; int k,m; float **rin,**rout; FILE *fp; rout=M2D_alloc(400,480); rin=M2D_alloc(400,480); SetFloatValue(400, 480, rin, -9999.0); SetFloatValue(400, 480, rout, -9999.0); setmode(fp,'b'); sprintf(data,"%s","00061_00.bin"); fp=fopen(ddd,"rb"); for(k=0;k<400;k++) fread( *(rin+k), sizeof (float), 480, fp); // Is this not working correctly in Win ME? fclose(fp); for(k=0;k<400; k++){ for(m=0;m<480;m++){ printf("%8.2f\n",rin[k][m]); } } M2DFree(rin,400); M2DFree(rout,400); } -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/