www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/04/30/04:52:28

From: Chris Jones <chris DOT jones AT ucl DOT ac DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: SIGSEGV problem with DJGPP (deleting array)
Date: Wed, 14 Apr 1999 02:00:49 GMT
Organization: Deja News - The Leader in Internet Discussion
Lines: 40
Message-ID: <7f0sse$51k$1@nnrp1.dejanews.com>
References: <7f0g7a$qg7$1 AT nnrp1 DOT dejanews DOT com> <7f0h9o$u6g$1 AT news8 DOT svr DOT pol DOT co DOT uk>
NNTP-Posting-Host: 128.40.205.1
X-Article-Creation-Date: Wed Apr 14 02:00:49 1999 GMT
X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 4.01; Windows 95)
X-Http-Proxy: 1.1 x7.dejanews.com:80 (Squid/1.1.22) for client 128.40.205.1
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

In article <7f0h9o$u6g$1 AT news8 DOT svr DOT pol DOT co DOT uk>,
  "Michael Stewart" <mike AT reggin DOT freeserve DOT co DOT uk> wrote:

> Trying to read one more element from ptr than whats available. This might
> give you your GPF.

It certainly won't help! Well spotted, thanks.

> Im assuming you want to increase the size of the array (ptr).

That's right....

> Try something
> like this.

It gets weirder and weirder. I tried simply correcting my mistake, and nothing
changed. I replace my function with your function and it gets a bit further.
However it's doing something even stranger now.

I get the same SIGSEGV error, but now it's occurring somewhere between the 2
lines of code below:

//(in the main function)
earth.get_element_at(2);
cout << "test3";

The function (which just reads the 2nd element) works OK and gives the correct
output, but then the program aborts before perfoming the cout!

Maybe I should go back to ZX Basic :(

Thanks for your help Michael....

--
Chris Jones

"Everybody who believes in psychokinesis, raise my right hand"

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019