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. General Programming
  3. C / C++ / MFC
  4. What's the difference between function atof() and _tstof()?

What's the difference between function atof() and _tstof()?

Scheduled Pinned Locked Moved C / C++ / MFC
c++question
3 Posts 3 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.
  • L Offline
    L Offline
    liuxianming2001
    wrote on last edited by
    #1

    CString a("2e3"); double b = atof(a); do right in VC++6.0 but wrong in VC++2008 CString a("2e3"); double b = _tstof(a); do right in VC++2008 but wrong in VC++6.0 :((

    stefanmihaimogaS D 2 Replies Last reply
    0
    • L liuxianming2001

      CString a("2e3"); double b = atof(a); do right in VC++6.0 but wrong in VC++2008 CString a("2e3"); double b = _tstof(a); do right in VC++2008 but wrong in VC++6.0 :((

      stefanmihaimogaS Offline
      stefanmihaimogaS Offline
      stefanmihaimoga
      wrote on last edited by
      #2

      It all depends if either _UNICODE or _MBCS are defined. Please check out MSDN for more information on this topic. Regards, Mihai Moga

      Computer Software Professional

      1 Reply Last reply
      0
      • L liuxianming2001

        CString a("2e3"); double b = atof(a); do right in VC++6.0 but wrong in VC++2008 CString a("2e3"); double b = _tstof(a); do right in VC++2008 but wrong in VC++6.0 :((

        D Offline
        D Offline
        Dan 0
        wrote on last edited by
        #3

        Thats the TCHAR mapping for atof/_wtof. By default vc2008 defines TCHAR as a native type. You can use it in vc6, you just need to do so explicitly.

        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