X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f X-Trace-PostClient-IP: 68.147.225.57 From: Brian Inglis Newsgroups: comp.os.msdos.djgpp Subject: Re: C programming errors Organization: Systematic Software Message-ID: References: <0JOK00CBNJLO0VL0 AT mta3 DOT srv DOT hcvlny DOT cv DOT net> X-Newsreader: Forte Agent 1.93/32.576 English (American) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 34 Date: Sat, 22 Sep 2007 03:46:02 GMT NNTP-Posting-Host: 64.59.135.176 X-Complaints-To: abuse AT shaw DOT ca X-Trace: pd7urf2no 1190432762 64.59.135.176 (Fri, 21 Sep 2007 21:46:02 MDT) NNTP-Posting-Date: Fri, 21 Sep 2007 21:46:02 MDT To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com On Tue, 18 Sep 2007 10:43:55 -0400 in comp.os.msdos.djgpp, Ethan Rosenberg wrote: >Dear List - > >Can someone please help me with the following C code. It aborts with >code 1. My apologies for the length of the code. > >Ethan > >============= >} > > fspacing = (float)spacing; > fgain = fspacing/3.0 + 2.0; > > gain = (int)fgain; > if(fgain - gain > 0.5) > gain = gain +1; > > return gain; > >} >====== It doesn't even compile with the above junk at the end. Run gcc -Wall -Wextra and fix all complaints first! -- Thanks. Take care, Brian Inglis Calgary, Alberta, Canada Brian DOT Inglis AT CSi DOT com (Brian[dot]Inglis{at}SystematicSW[dot]ab[dot]ca) fake address use address above to reply