www.delorie.com/archives/browse.cgi | search |
Subject: | Re: Need help with c! |
Approved: | clc AT plethora DOT net |
References: | <clcm-19990117-0010 AT plethora DOT net> <clcm-19990118-0001 AT plethora DOT net> <clcm-19990120-0006 AT plethora DOT net> |
From: | Francis Glassborow <francis AT robinton DOT demon DOT co DOT uk> |
X-Newsreader: | Turnpike (32) Version 3.05 <TilyaeicE$WmMOP9F8P4$y3lmP> |
Organization: | Southfield Microcomputer SS |
Lines: | 43 |
Mime-Version: | 1.0 |
Newsgroups: | comp.os.msdos.djgpp,comp.lang.c.moderated |
Message-ID: | <clcm-19990121-0005@plethora.net> |
Originator: | clcm AT plethora DOT net (Comp Lang C'Moderated) |
Date: | Thu, 21 Jan 1999 17:17:02 GMT |
NNTP-Posting-Host: | 205.166.146.5 |
X-Trace: | ptah.visi.com 916939022 205.166.146.5 (Thu, 21 Jan 1999 11:17:02 CDT) |
NNTP-Posting-Date: | Thu, 21 Jan 1999 11:17:02 CDT |
To: | djgpp AT delorie DOT com |
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
Reply-To: | djgpp AT delorie DOT com |
For the benefit of other readers, in an offline exchange I have ascertained that mohan is trying to execute his code with Windows98 without realising that such code must be run in a DOS Box In article <clcm-19990120-0006 AT plethora DOT net>, Mohanaraj Gopala Krishnan <mohangk AT pl DOT jaring DOT my> writes > > >Francis Glassborow wrote: > > >> OK you count through from 0 to array_size >> > >> >fscanf(fptr,"%d",*(pages_done++)); >> but here we have a very nasty trap >> pages_done was a pointer to an int (I guess it is to be an array) >> that means *(pages_done++) evaluates to the CONTENTS of the current >> address in pages_done before incrementing the address. But if you check >> fscanf you will find that it needs an address of an int. >> >> you need to write: >> fscanf(fptr,"%d", pages_done+i); >> > >I have done the changes but to no avail!!!. When I trace through i still >get >stuck there. There is no problem if I have not already created a file >chapter.dat. The problem arrises if the file already exists, it just >stops >running , gives a box which says program exit code 255 and there is also >another window which pops up and states Exiting due to signal SIGSEGV >and >General Protection Fault at ...and there is a bunch of numbers!!! I am >really stuck here and really cant figure anything out! Help please. >Thank >you. > >mohan Francis Glassborow Chair of Association of C & C++ Users 64 Southfield Rd Oxford OX4 1PA +44(0)1865 246490 All opinions are mine and do not represent those of any organisation -- comp.lang.c.moderated - clcm AT plethora DOT net
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |