#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2002
    Location
    Galway, Ireland
    Posts
    4
    Rep Power
    0

    Question changing type int/double to type char


    hey...this could be a real easy question.

    How can you change a type int or double to a type char? I need to be able to pass the number to a string so as it prints out the number, not the digits code in ascii.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Oct 2000
    Location
    Back in the real world.
    Posts
    5,966
    Rep Power
    191
    you want to make a string (char[] or char* ) of a number, not a char, right? use sprintf()
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2002
    Location
    State College, PA
    Posts
    0
    Rep Power
    0
    You can also static_cast the var....
    charVar = static_cast<char>intVar

    ~Trex~

IMN logo majestic logo threadwatch logo seochat tools logo