Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!ncar!hsdndev!husc6!huang From: huang@husc8.harvard.edu (Howard Huang) Newsgroups: comp.lang.c Subject: Re: Neophyte seeks scanf() help Message-ID: Date: 12 Mar 91 01:17:14 GMT References: <1991Mar9.043725.23936@watdragon.waterloo.edu> Sender: news@husc6.harvard.edu Organization: Harvard Arts and Sciences Computer Services, Cambridge, MA Lines: 30 In-reply-to: dsebbo@dahlia.uwaterloo.ca's message of 9 Mar 91 04:37:25 GMT >float get_tax(void) >{ > float tax; > > printf("Enter the tax: "); > scanf("%f", &tax); > printf("The tax is %.4f\n", tax); > > return tax; >} > >Running it produces the following: >Enter the tax: 0.01 >The tax is 0.1000 That looks like a bug in your compiler... Some earlier versions of Symantec's THINK C have this funny scanf bug. I'm sure you could call Symantec and ask them how to fix the bug, or maybe you can find something on one of the Mac ftp sites (sumex.stanford.edu). -- ---------------------------------------------------------------------------- Howard C. Huang Internet: huang@husc9.harvard.edu Junior Computer Science Major Bitnet: huang@husc9.BITNET Mather House 030, Harvard College UUCP: huang@husc9.UUCP (I think) Cambridge, MA 02138 Apple II: ftp husc6.harvard.edu