Thread: Ascii

  1. #1
    C / C++
    Join Date
    Jan 2006
    Location
    The Netherlands
    Posts
    312

    Ascii

    according to www.lookuptables.com, ASCII 251 should be a square root character. but when I enter

    Code:
    (char) 251
    in my source, it shows this: ¹ (exponential 1). What is wrong?
    Operating Systems:
    - Ubuntu 9.04
    - XP

    Compiler: gcc

  2. #2
    Tropical Coder Darryl's Avatar
    Join Date
    Mar 2005
    Location
    Cayman Islands
    Posts
    503
    Quote Originally Posted by Ideswa
    according to www.lookuptables.com, ASCII 251 should be a square root character. but when I enter

    Code:
    (char) 251
    in my source, it shows this: ¹ (exponential 1). What is wrong?
    when I cout it to the console it is the root symbol, which leads me to believe maybe you are using this in windows.

    Not all characters sets map all the extended ascii characters, so check the font you are using to see if it maps the root symbol to 251

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Everything outside of 0x20 to 0x7F is dependent on your OS/Compiler/Font/Code Page or whatever.

    Being a windows machine, who knows what code page / font you get by default.
    It's likely to depend for starters on whether you're writing a console or a GUI program.

    251 in unicode is a û
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. ASCII character with ASCII value 0 and 32
    By hitesh_best in forum C Programming
    Replies: 4
    Last Post: 07-24-2007, 09:45 AM
  2. Replies: 11
    Last Post: 03-24-2006, 11:26 AM
  3. Office access in C/C++ NOT VC++!! :)
    By skawky in forum C++ Programming
    Replies: 1
    Last Post: 05-26-2005, 01:43 PM
  4. ascii values for keys
    By acid45 in forum C Programming
    Replies: 2
    Last Post: 05-12-2003, 07:13 AM
  5. Checking ascii values of char input
    By yank in forum C Programming
    Replies: 2
    Last Post: 04-29-2003, 07:49 AM