Topic: Please help...


Author: mcbride@ee.ualberta.ca (Eurodean)
Date: 22 May 1994 22:58:08 GMT
Raw View
Richard Fogarasi (richard.fogarasi@canrem.com) wrote:
> Hi everybody,

> I am not sure if I am in the right conference, but I am a newbee to the
> world of C, and having a substantial project at hand, I keep running
> into problems. I am using Turbo C 2.0. Please look at my questions and
> if you can help in any way, please don't hesitate to e-mail me, or leave
> me a line or two in this conf. Thanks a lot for your help...

Well, this is the C++ conf, but we all know C, too.  <g>

> 1) The 'atof ()' function does not seem to work. [used to convert
>    strings to doubles]. I keep getting the error message:
>    " scanf: floating point formats not linked. Abnormal Program
>    Termination. "  I have tried a few things (e.g. declaring atof()
>    at the beginning), but nothing seems to work. I have included
>    stdio.h and stdlib.h.

Do you have the floating-point libraries linked?  Din't think so.  I
can't remember WHERE it is there... ah, there it is.  Options >> Compiler >>
Code generation >> Floating point
This probably says "None".  Change it to either Emulation or 8087/80287.

--
---------------------------------------------------------------------------
|Darin McBride           |Team OS/2 - where the future is....             |
|  mcbride@ee.ualberta.ca|Windows: brought to you by the makers of EdLin  |
---------------------------------------------------------------------------




Author: richard.fogarasi@canrem.com (Richard Fogarasi)
Date: Fri, 20 May 94 20:52:00 -0400
Raw View
Hi everybody,

I am not sure if I am in the right conference, but I am a newbee to the
world of C, and having a substantial project at hand, I keep running
into problems. I am using Turbo C 2.0. Please look at my questions and
if you can help in any way, please don't hesitate to e-mail me, or leave
me a line or two in this conf. Thanks a lot for your help...

PROBLEMS:

1) The 'atof ()' function does not seem to work. [used to convert
   strings to doubles]. I keep getting the error message:
   " scanf: floating point formats not linked. Abnormal Program
   Termination. "  I have tried a few things (e.g. declaring atof()
   at the beginning), but nothing seems to work. I have included
   stdio.h and stdlib.h.

2) This one is REAAALLLY annoying, because I know it's something simple.
   How do you convert an integer into string. E.g. how does one make
   123 into '123' ??? Or how to set up an array of strings which contain
   '1', '2', '3', '4', '5' etc.. It's gotta be something simple.

I know I may run into simple problems like this, so if you could help me
out, I would be VERY grateful.


Thanks for your attention,

Norbert Fogarasi    --- E-Mail: richard.fogarasi@canrem.com
                         -or-   e0fel4x8@credit.erin.utoronto.ca
                         -or-   norbef@eratos.erin


... Don't hit me, Mr. Moderator... I'll go back on topic... I swear!

... The OFFICIAL tagline of the 1996 Olympics!
___ Blue Wave/QWK v2.12




Author: mgaller@ux1.cso.uiuc.edu (galler michael a)
Date: 21 May 1994 18:28:36 GMT
Raw View
richard.fogarasi@canrem.com (Richard Fogarasi) writes:

>Hi everybody,

>I am not sure if I am in the right conference, but I am a newbee to the
You probably should be in comp.std.c, but I'm not going to bite your
head off about it.

>world of C, and having a substantial project at hand, I keep running
>into problems. I am using Turbo C 2.0. Please look at my questions and
>if you can help in any way, please don't hesitate to e-mail me, or leave
>me a line or two in this conf. Thanks a lot for your help...

>PROBLEMS:

>1) The 'atof ()' function does not seem to work. [used to convert
>   strings to doubles]. I keep getting the error message:
>   " scanf: floating point formats not linked. Abnormal Program
>   Termination. "  I have tried a few things (e.g. declaring atof()
>   at the beginning), but nothing seems to work. I have included
>   stdio.h and stdlib.h.
Try declaring a float variable and doing something trivial with it at the
beginning of the program.  Or initliaze one globally.  This _may_
automatically link in the floating point formats.  If that doesn't work,
look under the compiler options menus until you see something that looks
like it will let you link them in. (I'm not familiar with Turbo C, only
Borland C 3.1, so I can't tell you exactly where to go).

>2) This one is REAAALLLY annoying, because I know it's something simple.
>   How do you convert an integer into string. E.g. how does one make
>   123 into '123' ??? Or how to set up an array of strings which contain
>   '1', '2', '3', '4', '5' etc.. It's gotta be something simple.
Yes, it is simple.  Look at the command sprintf().
BIG hint-  try sprintf(string_name,"%d",int_name);
It's not the only way, but it's the easiest and most portable.

>I know I may run into simple problems like this, so if you could help me
>out, I would be VERY grateful.
No problem..

Mike