scanf() problem in Turbo C++ 1.00 but NOisc

AHB3 at Lehigh AHB3 at Lehigh
Tue Oct 16 09:58:51 AEST 1990


The problem is a bug.  Pure and simple.  I have heard that Turbo C 1.0
had the same problem.  What is happening is the compiler doesn't
realize that the variable being passed in is a floating point number,
so it don't link in the floating point routines to scanf.  When you
uncomment the first scanf line, the compiler links the floating point
routines into scanf.  If you didn't know, the compiler doesn't know
that the scanf routine will try to print a floating point number.
Only scanf knows.  The format string used by scanf is just a string to
the compiler.  Therefore, until they fix the bug (again), people will
have to use temporary variables for floats and doubles.


                                         Arthur H. Boyd
                                         Lehigh U.



More information about the Comp.lang.c mailing list