Thread: integer to character

  1. #1
    Registered User
    Join Date
    Feb 2003
    Posts
    57

    integer to character

    Hi,
    I have a program where I am using an integer array. I had to get some character input from the keyboard and store it in the integer array which worked fine since it stored it as the ascii integer. However, I now need to output the characters back to the screen but when I do a simple cout statement it obviously stays in the ascii integer. My question is........is there a way to output an integer in its ascii character form?

  2. #2
    Registered User
    Join Date
    Feb 2003
    Posts
    57
    nevermind, I found the answer on one of the articles

  3. #3
    Registered User
    Join Date
    Apr 2003
    Posts
    2,663
    Check the answer against this C++ style cast:

    static_cast<char>(yourIntVal)

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Link List math
    By t014y in forum C Programming
    Replies: 17
    Last Post: 02-20-2009, 06:55 PM
  2. Direct3D problem
    By cboard_member in forum Game Programming
    Replies: 10
    Last Post: 04-09-2006, 03:36 AM
  3. Please Help - Problem with Compilers
    By toonlover in forum C++ Programming
    Replies: 5
    Last Post: 07-23-2005, 10:03 AM
  4. mygets
    By Dave_Sinkula in forum C Programming
    Replies: 6
    Last Post: 03-23-2003, 07:23 PM