Message-ID: <3D479194.3998CB1B@acm.org> From: Eric Sosman X-Mailer: Mozilla 4.72 [en] (Win95; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.os.msdos.djgpp Subject: Re: fread can't read a second time. References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 16 Date: Wed, 31 Jul 2002 12:26:55 GMT NNTP-Posting-Host: 12.91.2.70 X-Complaints-To: abuse AT worldnet DOT att DOT net X-Trace: bgtnsc04-news.ops.worldnet.att.net 1028118415 12.91.2.70 (Wed, 31 Jul 2002 12:26:55 GMT) NNTP-Posting-Date: Wed, 31 Jul 2002 12:26:55 GMT Organization: AT&T Worldnet To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Patrick Chen wrote: > [...] > When I put the second block to process the green.bmp, > SIGSEGV general protection fault occur at the fread of the second block. Are you sure the second fopen() succeeds? Notice that the program does *not* check for its success or failure: > fin2=fopen("green.bmp","rb"); ^^^^ > if(fin==NULL) ^^^ -- Eric Sosman esosman AT acm DOT org