Message-ID: <022b01bec33e$6d46d5a0$12d098cd@co.alachua.fl.us> From: "Dean Limbaugh" To: References: <930735428 DOT 887115 AT kyle DOT inet DOT net DOT nz> Subject: Re: Files with GCC Date: Wed, 30 Jun 1999 17:20:49 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Reply-To: djgpp AT delorie DOT com should be fscanf(objFile,"%d",&points); your trying to use the value in points as a poiter to the location to store the value. This is probally 0 ----- Original Message ----- From: David Mitchell Newsgroups: comp.os.msdos.djgpp To: Sent: Wednesday, June 30, 1999 5:22 AM Subject: Files with GCC > Could somebody tell me what is wrong with this code? > > int points; > FILE *objFile; > > objFile = fopen(fname, "rt"); > > fscanf(objFile, "%d", points); > > When I run this, my program crashes with this message: > > Exiting due to signal SIGSEG > Page fault at eip=00005df6, error=0006 > eax=00000001 ebx=00066ac0 ecx=00066900 edx=001a41a0 esi=00001bcc > edi=00000037 > ebp=00066a30 esp=000669b0 program=D:\DAVID\OBJ\A.EXE > cs: sel=00a7 base=82dae000 limit=0007ffff > ds: sel=00af base=82dae000 limit=ffffffff > es: sel=00af base=82dae000 limit=ffffffff > fs: sel=0087 base=0001c0a0 limit=0000ffff > gs: sel=00bf base=00000000 limit=ffffffff > ss: sel=00af base=82dae000 limit=ffffffff > > Call frame traceback EIPs: > 0x00005df6 > 0x0000597a > 0x00005743 > 0x00002b86 > 0x00001cbf > 0x00002092 > 0x0000261a > > What's wrong? Sorry if this is a bit vague. > > David > > > >