From owner-freebsd-bugs Thu Feb 26 06:30:03 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id GAA24766 for freebsd-bugs-outgoing; Thu, 26 Feb 1998 06:30:03 -0800 (PST) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: (from gnats@localhost) by hub.freebsd.org (8.8.8/8.8.8) id GAA24733; Thu, 26 Feb 1998 06:30:01 -0800 (PST) (envelope-from gnats) Date: Thu, 26 Feb 1998 06:30:01 -0800 (PST) Message-Id: <199802261430.GAA24733@hub.freebsd.org> To: freebsd-bugs Cc: From: Zach Heilig Subject: Re: misc/5856: atof/strtod busted Reply-To: Zach Heilig Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org The following reply was made to PR misc/5856; it has been noted by GNATS. From: Zach Heilig To: aryeh@rad-inet.com, freebsd-gnats-submit@FreeBSD.ORG Cc: Subject: Re: misc/5856: atof/strtod busted Date: Thu, 26 Feb 1998 07:36:56 -0600 On Thu, Feb 26, 1998 at 12:04:58AM -0800, aryeh@rad-inet.com wrote: > >Description: > atof for any string either containing numbers, alpa, or alphanum always > returns a value of 1 > >How-To-Repeat: > main() > { > duble foo; > > foo=atof("3.145"); > printf("%f",foo); > } You need to include headers for the functions you call. In this case, you need for printf() and for atof. Then your program works: #include #include int main(void) { double foo; foo = atof("3.1415"); printf("%f\n", foo); return 0; } To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message