On Fri, Mar 08, 2002 at 03:31:15PM -0600, Mike Barton wrote:
> [EMAIL PROTECTED] red]$ cat test.c
> #include <stdio.h>
> 
> int main() {
>   char string[1024] = "1.00";
>   printf("atof(%s) = %f\n", string, atof(string));
> }
> 
> [EMAIL PROTECTED] red]$ make test
> cc     test.c   -o test
> [EMAIL PROTECTED] red]$ ./test
> atof(1.00) = 0.000000
> 
> It took me like a half hour to figure out that if you don't include stdlib.h, 
> atof points to never-never land.

If you had run gcc with -Wall, you would have seen this:
test.c:5: warning: implicit declaration of function `atof'

Edwin

-- 
Edwin Groothuis   |              Personal website: http://www.MavEtJu.org
[EMAIL PROTECTED] |           Interested in MUDs? Visit Fatal Dimensions:
------------------+                       http://www.FatalDimensions.org/

Reply via email to