Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Journal of nicholas (3034)

Tuesday June 22, 2004
04:16 AM

C99 is not C

[ #19421 ]

While it's on my mind... what's the output from the following C program?

#include <stdio.h>
#include <stdlib.h>

int main() {
  const char *foo = "0x3";
  printf("'%s' is %g\n", foo, atof(foo));
  return 0;
}

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • 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