Path: chuka.playstation.co.uk!news From: Majik Newsgroups: scee.yaroze.programming.gnu_compiler Subject: Re: printf works, code doesn't Date: Wed, 15 Apr 1998 09:42:51 +0100 Organization: PlayStation Net Yaroze (SCEE) Lines: 38 Message-ID: <3534730B.2417@127.0.0.1> References: <3532D4BA.49B30CA9@sinclair.net> NNTP-Posting-Host: darkstar.stnc.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 3.0 (WinNT; I) > double Slope(int a,int b) > { > u_long X1,Y1,X2,Y2; > double Fun; > > X1=Dude[a].position.vx; > Y1=Dude[a].position.vz; > X2=Dude[b].position.vx; > Y2=Dude[b].position.vz; > printf2("\n%d / %d = %e -- ",Y2-Y1,X2-X1, (Y2-Y1) / (X2-X1)); > //printf2 = printf that supports %e Fun=((Y2-Y1) / (X2-X1)); > printf("%e",Fun); > > return (Fun); // Used to be return ((Y2-Y1) / (X2-X1)); - Same thing happened > } Is this the actaul code you are using? I only ask because 'Fun' isnt assigned any value, it is hidden by the // comment, what happens if you do //printf2 = printf that supports %e Fun=((Y2-Y1) / (X2-X1)); instead of > //printf2 = printf that supports %e Fun=((Y2-Y1) / (X2-X1)); or is it just my mailreader that has screwed that bit up, sorry if I've been patronising. M. -- -- Majik - Owner/Curator of the Sinclair Microcomputer Museum -- Spod in a suitcase - ' Have Compiler, will travel ' -- http://mudhole.spodnet.uk.com/~majik/ --