-
compiler problems
using borland turbo c 2.01.
I am currently checking and amending a program. When i step thru the program all goes well till i reach a line of code thus
batch.cre.cust_bal = atof(str)
whereupon the terminates thus
scanf : floating point formats not linked
abnormal program termination
I have the header file for the function atof.
the program should read a text file, just before the offending line i read the string using fgets to place into 'str' putting a watch on 'str' the correct data goes into 'str' but upon the next line ........
any thoughts.
-
Stop using a stone-age compiler for one thing
Back in the days of yore, when processors didn't have math coprocessors, all the floating point code was done in software.
To save space in the executable (because that's a good thing from the marketroids), the floating point library is usually omitted. But the compiler is supposed to auto detect your use of floating point, and include the library.
Problem is, its a broken algorithm.
The alleged fix is to say something like
double dummy_cos_my_compiler_is_lame = 1.0;