delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/03/15/09:15:05

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f
From: Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: help please! =)
Date: 15 Mar 2002 14:09:43 GMT
Organization: Aachen University of Technology (RWTH)
Lines: 18
Distribution: world
Message-ID: <a6svb7$6rr$1@nets3.rz.RWTH-Aachen.DE>
References: <T0nk8.3138$523 DOT 247408 AT ozemail DOT com DOT au>
NNTP-Posting-Host: acp3bf.physik.rwth-aachen.de
X-Trace: nets3.rz.RWTH-Aachen.DE 1016201383 7035 137.226.32.75 (15 Mar 2002 14:09:43 GMT)
X-Complaints-To: abuse AT rwth-aachen DOT de
NNTP-Posting-Date: 15 Mar 2002 14:09:43 GMT
Originator: broeker@
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

james watmuff <ammojamo AT hotmail DOT com> wrote:

[...]
> (in my program, main() ) it does not seem to be returning the value... 
> to be even more bizarre, when i comment out the 'free(weight_of_x)' line,
> the function returns 11.0, but otherwise it returns 0.0

That's a rather sure sign of your program doing something badly wrong
regarding memory allocation earlier on, or it simply wrote past the
end of some array.  What you're observing is what the C gurus call
"undefined behaviour", caused by some bug in your code.

The actual problem quite probably is in some other part of the
program, which you didn't show here.

-- 
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.

- Raw text -


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