While it's on my mind... what's the output from the following C program?
#include
#include
int main() {
const char *foo = "0x3";
printf("'%s' is %g\n", foo, atof(foo));
return 0;
}
Intriguing
jonasbn on 2004-06-27T08:55:04
I am a C newbie, so I am always intriguied by small C snippets.
I guess you expected either scientific notation or 6 digits?
But how do you specify what notation should be used? - I can get the proper notation by explicitly specifying
%E
or
%F
jonasbn