Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. C / C++ / MFC
  3. sscanf and double

sscanf and double

Scheduled Pinned Locked Moved C / C++ / MFC
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Claude Gagnon
    wrote on last edited by
    #1

    Hi, I can convert the value of a CString to a float with sscanf: sscanf( strnumber, "%f", &m_dAg); I have tried to do this wiht a double, but it doesn't work. Is it possible to do that ? Thanks for any help, Claude

    J T A 3 Replies Last reply
    0
    • C Claude Gagnon

      Hi, I can convert the value of a CString to a float with sscanf: sscanf( strnumber, "%f", &m_dAg); I have tried to do this wiht a double, but it doesn't work. Is it possible to do that ? Thanks for any help, Claude

      J Offline
      J Offline
      Jignesh Patel 0
      wrote on last edited by
      #2

      use atof

      1 Reply Last reply
      0
      • C Claude Gagnon

        Hi, I can convert the value of a CString to a float with sscanf: sscanf( strnumber, "%f", &m_dAg); I have tried to do this wiht a double, but it doesn't work. Is it possible to do that ? Thanks for any help, Claude

        T Offline
        T Offline
        TBK
        wrote on last edited by
        #3

        Try using: sscanf( strnumber, "%lf", &m_dAg); lf should be used for doubles

        1 Reply Last reply
        0
        • C Claude Gagnon

          Hi, I can convert the value of a CString to a float with sscanf: sscanf( strnumber, "%f", &m_dAg); I have tried to do this wiht a double, but it doesn't work. Is it possible to do that ? Thanks for any help, Claude

          A Offline
          A Offline
          Andrei Zenkovitch
          wrote on last edited by
          #4

          You might also try strtod() function. Regards, Andrei zenkovitch Dundas Software

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups