conversion

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • fanda00
    New Member
    • Oct 2007
    • 2

    conversion

    hi can anyone help me out here. im trying to convert a string of numbers to int in c++, but have some difficulties.

    can you show me how to do it.

    regards Fanda
  • Ganon11
    Recognized Expert Specialist
    • Oct 2006
    • 3651

    #2
    Check out the atoi() function.

    Comment

    • fanda00
      New Member
      • Oct 2007
      • 2

      #3
      atoi() is for char[] and not for datatype string.

      Comment

      • oler1s
        Recognized Expert Contributor
        • Aug 2007
        • 671

        #4
        Originally posted by fanda00
        atoi() is for char[] and not for datatype string.
        Ahh, could have told us that, no?

        But really, look up stringstreams. While the C functions are always available, if you want to do conversions, use stringstreams in C++. If you're having trouble understanding the material you find on Google, feel free to continue asking here.

        Comment

        Working...