Re: strtod vs NAN?

From: Brandon S. Allbery KF8NH <allbery_at_ece.cmu.edu>
Date: Thu, 13 May 2004 22:21:23 -0400
On Thu, 2004-05-13 at 22:14, Larry Rosenman wrote:
>   char **ptr;
> 
>   num=strtod(input,ptr);

Since ptr is uninitialized, strtod() is trying to store a pointer into
random memory.  You probably want to say this instead:

    char *ptr;

    num = strtod(input, &ptr);

-- 
brandon s. allbery    [linux,solaris,freebsd,perl]     allbery_at_kf8nh.com
system administrator      [WAY too many hats]        allbery_at_ece.cmu.edu
electrical and computer engineering, carnegie mellon univ.         KF8NH
Received on Thu May 13 2004 - 17:21:25 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:54 UTC