Thread: problem with atof

  1. #16
    Registered User
    Join Date
    Jan 2005
    Posts
    184
    thax very much quzah

    s.s.harish

  2. #17
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >printf("%lf",converted[i-1]);
    Just for the record, %lf is wrong too. printf uses %f for both float and double, and %Lf for long double. In C89, %lf is undefined behavior and in C99, %lf has been added to accept long double. This is contrary to scanf, where %f takes a pointer to float and %lf takes a pointer to double.

    Come to think of it, you really should avoid floating-point wherever possible to save yourself a lot of trouble.
    My best code is written with the delete key.

  3. #18
    Registered User
    Join Date
    Jan 2005
    Posts
    184
    thank u prelude for letting me know about the C89 and C99

    s.s.harish

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need help understanding a problem
    By dnguyen1022 in forum C++ Programming
    Replies: 2
    Last Post: 04-29-2009, 04:21 PM
  2. Memory problem with Borland C 3.1
    By AZ1699 in forum C Programming
    Replies: 16
    Last Post: 11-16-2007, 11:22 AM
  3. Someone having same problem with Code Block?
    By ofayto in forum C++ Programming
    Replies: 1
    Last Post: 07-12-2007, 08:38 AM
  4. A question related to strcmp
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 07-07-2007, 02:51 PM
  5. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 06:54 PM