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. CString to long

CString to long

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

    Hi all How can i convert CString to long.I am try this

    CString Content="000995688787";
    int newintval=atoi(Content);
    result is
    newintval=225212472
    and
    __int64 n64Tmp=_atoi64(Content);
    result is
    n64Tmp=225212472

    R 1 Reply Last reply
    0
    • D Davitor

      Hi all How can i convert CString to long.I am try this

      CString Content="000995688787";
      int newintval=atoi(Content);
      result is
      newintval=225212472
      and
      __int64 n64Tmp=_atoi64(Content);
      result is
      n64Tmp=225212472

      R Offline
      R Offline
      Rajesh R Subramanian
      wrote on last edited by
      #2

      You must have used atol (or rather _ttol) instead of atoi. See CString::Format() member if you're already using CString.

      It is a crappy thing, but it's life -^ Carlo Pallini

      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