problem with atof

This is a discussion on problem with atof within the C Programming forums, part of the General Programming Boards category; thax very much quzah s.s.harish...

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

    s.s.harish

  2. #17
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    >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
    181
    thank u prelude for letting me know about the C89 and C99

    s.s.harish

Page 2 of 2 FirstFirst 12
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, 05: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, 09:38 AM
  4. A question related to strcmp
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 07-07-2007, 03:51 PM
  5. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 07:54 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21