X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f From: Hans-Bernhard Broeker 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: References: 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 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.