Re: strtod vs NAN?

From: Larry Rosenman <ler_at_lerctr.org>
Date: Thu, 13 May 2004 21:24:17 -0500
--On Thursday, May 13, 2004 22:21:23 -0400 "Brandon S. Allbery KF8NH" 
<allbery_at_ece.cmu.edu> wrote:

> 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);

Thanks.  Stupid C error(s) from a novice :).

That was indeed it.




-- 
Larry Rosenman                     http://www.lerctr.org/~ler
Phone: +1 972-414-9812                 E-Mail: ler_at_lerctr.org
US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749

Received on Thu May 13 2004 - 17:24:21 UTC

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