| delorie.com/archives/browse.cgi | search |
| X-Authentication-Warning: | delorie.com: mail set sender to djgpp-bounces using -f |
| X-Trace-PostClient-IP: | 68.147.225.57 |
| From: | Brian Inglis <Brian DOT Inglis AT SystematicSW DOT Invalid> |
| Newsgroups: | comp.os.msdos.djgpp |
| Subject: | Re: C programming errors |
| Organization: | Systematic Software |
| Message-ID: | <rt39f31dqn8h0vcnf6rrt22029r89hqoi6@4ax.com> |
| 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 |
| 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 <ethros AT earthlink DOT net> 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
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |