www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/03/15/09:41:12

From: "Graham Reeds" <grahamr AT ntlworld DOT com>
Newsgroups: comp.os.msdos.djgpp
References: <AKUr6.3065$y47 DOT 695473 AT news2-win DOT server DOT ntlworld DOT com> <98qg3a$nc9$1 AT nets3 DOT rz DOT RWTH-Aachen DOT DE>
Subject: Re: Problem with allocating memory for linked lists.
Lines: 29
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4133.2400
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
Message-ID: <ue4s6.4431$y47.893982@news2-win.server.ntlworld.com>
Date: Thu, 15 Mar 2001 14:22:20 -0000
NNTP-Posting-Host: 62.254.78.155
X-Complaints-To: abuse AT ntlworld DOT com
X-Trace: news2-win.server.ntlworld.com 984666138 62.254.78.155 (Thu, 15 Mar 2001 14:22:18 GMT)
NNTP-Posting-Date: Thu, 15 Mar 2001 14:22:18 GMT
Organization: ntlworld News Service
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

> Sorry, but that description is just too imprecise for anyone likely to
> be able to help you. Please minimize your code down to the smallest
> you can up with that still shows the problem, and send it, along with
> as precise an error description as you can get: crash dumps, error
> messages, whatever: send it.
>
> Just try to keep in mind that none of us is clairvoyant...

I know you aren't clairvoyant.  I was trying not to post a hundred lines of
code.  Anyway, it's all fairly academic since a friend of mine fired several
suggestions at me, one of which hit the target: I was allocating memory for
the linkedlist_t structure, which is a pointer to record_t, but I wasn't
allocating memory for record_t, and ergo it died a horrible death.  Why it
worked previously without error is anyones guess.

However, slightly off topic, when compiled under VC6 the line containing
record->sortkey = ((rand()) % 1000000) - 500000;
only produces numbers under 0.  Anyway, that line is just for testing so I'm
not too bothered really.

Thanks for responding promptly.

--

Stay Lucky, Graham "Mournblade" Reeds,
ICQ: 30514803
http://homepage.dtn.ntl.com/grahamr


- Raw text -


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