Xref: utzoo comp.sys.ibm.pc:44168 alt.msdos.programmer:1207 Path: utzoo!mnetor!geac!maccs!cs4g6ag From: cs4g6ag@maccs.dcss.mcmaster.ca (Stephen M. Dunn) Newsgroups: comp.sys.ibm.pc,alt.msdos.programmer Subject: Re: scanf problem in TC v2.01. Message-ID: <25D4D935.3073@maccs.dcss.mcmaster.ca> Date: 11 Feb 90 03:17:09 GMT References: <7192.25d1e107@dit.ie> Reply-To: cs4g6ag@maccs.dcss.mcmaster.ca (Stephen M. Dunn) Organization: McMaster University, Hamilton, Ontario Lines: 26 In article <7192.25d1e107@dit.ie> alawlor@dit.ie (Aengus Lawlor) writes: $I'm having a problem using scanf in Turbo C 2.01. $When I have the code $ fscanf(f,"%f",x); $it compiles and links fine, but at run time I get $ scanf : floating point formats not linked $Abnormal program termination I've had problems with scanf under TCC 2.0. Given something like scanf ("%f", &floatvariable); it will read the keyboard but return garbage (sometimes 0, sometimes NAN, sometimes other values). atof is the cause of this problem; I've tried scanf ("%s", stringvariable); floatvariable = atof (stringvariable); and it has the same problem (not surprising, since scanf calls atof to handle floating point quantities). $Aengus Lawlor Dept of Computer Science. Time flies like an arrow, $ALAWLOR@DIT.IE Dublin Institute of Technology. Fruit-flies like a banana $ Kevin Street. Dublin 8. Ireland. And time flies when you're having fun. -- Stephen M. Dunn cs4g6ag@maccs.dcss.mcmaster.ca = "\nI'm only an undergraduate!!!\n"; **************************************************************************** I Think I'm Going Bald - Caress of Steel, Rush