From: "Tony O'Bryan" Newsgroups: comp.os.msdos.djgpp Subject: Re: fopen() gives Segmentation Fault. Help ? Date: Wed, 12 Nov 1997 21:48:15 -0600 Organization: Southwest Missouri State University Lines: 12 Message-ID: <346A787F.5981@nic.smsu.edu> References: <3 DOT 0 DOT 16 DOT 19971111193131 DOT 35afdc80 AT hem1 DOT passagen DOT se> <3468C09B DOT 436A AT nortel DOT ca> Reply-To: aho450s AT nic DOT smsu DOT edu NNTP-Posting-Host: clark.a40.smsu.edu Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Oon Lin wrote: > > I'm having problem using fopen() in DJGPP. What happened is that I made a > first fopen() call to open a file for reading only and that works > fine..and when I call the second fopen() (after I closed the first > fopen()) it just gives me General Protection Fault with Segmentation > violation .... anybody has any ideas ?? Your program compiled and ran fine on my machine. I added a return if the file couldn't be opened for read, and I #included and formatted the code to my taste, but I didn't change any other statements.