Thread: ascii characters

  1. #1
    Registered User
    Join Date
    Dec 2001
    Posts
    206

    ascii characters

    When i try typing the ascii character for Space, why does it come out different than whn i press space bar?
    What is the real ascii for space and enter? thx in advance

  2. #2
    Registered User
    Join Date
    Mar 2002
    Posts
    1,595
    cout << "hit the space bar to find out the ASCII integer value for it " <<
    char dummy;
    cin >> dummy;
    cout << "= " << (int)dummy << endl;
    cout << "and hit the enter key to find out the ASCII integer value for it ";
    cin >> dummy;
    cout << "= " << (int)dummy;

  3. #3
    Registered User
    Join Date
    Dec 2001
    Posts
    206
    thats KOOL!!!

    too bad it doesnt work for enter and spacebar *laughs at you*

  4. #4
    Registered User
    Join Date
    Mar 2002
    Location
    South Africa
    Posts
    35

    ascii codes

    when you press enter, two characters are entered: carriage return (CR) and line feed (LF).
    According to my ASCII table,
    CR = 13
    and
    LF = 10
    (those are decimal, not hex)
    .

    Again according to my ASCII table, try 32 for space. If that doesn't work, i would try 0 (zero). If that doesn't work, try ' '.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 10
    Last Post: 07-10-2008, 03:45 PM
  2. Replies: 11
    Last Post: 03-24-2006, 11:26 AM
  3. ascii characters video displaying on tv screen
    By deian in forum C Programming
    Replies: 6
    Last Post: 10-12-2004, 09:46 PM
  4. ASCII Printable Characters
    By dalek in forum C# Programming
    Replies: 3
    Last Post: 08-11-2003, 04:13 AM
  5. Printing extended ASCII characters
    By Jonny M in forum C Programming
    Replies: 2
    Last Post: 03-01-2002, 10:12 AM