home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / c / 19075 < prev    next >
Encoding:
Text File  |  1992-12-31  |  980 b   |  26 lines

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!mcsun!news.funet.fi!hydra!klaava!wirzeniu
  3. From: wirzeniu@klaava.Helsinki.FI (Lars Wirzenius)
  4. Subject: Re: FP formats not linked
  5. Message-ID: <1992Dec31.155812.267@klaava.Helsinki.FI>
  6. Organization: University of Helsinki
  7. References: <1992Dec30.023547.1076@cpp.uucp> <steve.00nf@Celeborn.lvunix.com>
  8. Date: Thu, 31 Dec 1992 15:58:12 GMT
  9. Lines: 15
  10.  
  11. steve@Celeborn.lvunix.com (Steve Slade) writes:
  12. >Rich Bauer (root@cpp.uucp) wrote:
  13. >:       scanf("%lf", &b_avg[i]);
  14. [...]
  15. >because scanf is looking for a long double and you declared it has only a 
  16. >double.
  17.  
  18. No, scanf is looking for a (pointer to) double.  For scanf, %f is
  19. float, %lf is double, and %Lf is long double.  Further explanations in
  20. any good book about C (checking one before posting about minor
  21. details, or even larger ones, is often a good idea, btw).
  22.  
  23. --
  24. Lars.Wirzenius@helsinki.fi  (finger wirzeniu@klaava.helsinki.fi)
  25.    MS-DOS, you can't live with it, you can live without it.
  26.