sscanf for doubles

Posted by bobobobo on Stack Overflow See other posts from Stack Overflow or by bobobobo
Published on 2010-04-25T01:20:27Z Indexed on 2010/04/25 1:23 UTC
Read the original article Hit count: 350

Filed under:
|

This is a simple problem, but I can't see it:

  char *s = "f 8.649292" ;
  double d ;
  sscanf( s, "f %f", &d ) ;

  printf( "d is %f\n", d ) ;

Why is d not containing the double value 8.649292?

© Stack Overflow or respective owner

Related posts about c

    Related posts about sscanf