Thread: ASCII - I think?

  1. #1
    Unregistered
    Guest

    Post ASCII - I think?

    Hello,

    I am trying to make a box.. now, everything looks good except I can't find a good way to make the corners.. I have seen people use 4 corners (I guess there ascii) so I was wondering what the ALT code was for that, or maybe char(somthing).. any help would be nice..

    right now I have

    _____________
    | x x x x x x x x x |
    | x x x x x x x x x |
    | x x x x x x x x x |
    | x x x x x x x x x |
    |_____________|

  2. #2
    Casual Visitor
    Join Date
    Oct 2001
    Posts
    350
    A very crude method using iostream alone would be to use the hex value of the characters that you want to display. For example

    cout << "\xC9"; // double line upper left corner
    cout << "\xDA"; // single line upper left corner

    for(int line = 1; line <=10; line++)
    cout << "\xCD" // draw a horizontal line.
    I haven't used a compiler in ages, so please be gentle as I try to reacclimate myself. :P

  3. #3
    Unregistered
    Guest
    The single upper left corner shall work perfectly.. by chance, do you have the single right, bottom left, and bottom right..

    also by chance the hex of |

  4. #4
    Unregistered
    Guest
    single line box:

    0xDA 0xC4 0xBF
    0xB3 0xB3
    0xC0 0xC4 0xD9

  5. #5
    Casual Visitor
    Join Date
    Oct 2001
    Posts
    350
    You can do the same thing using unsigned char. Take a look into the ascii codes in many programming books.

    unsigned char drawme;

    drawme = 218;

    cout << drawme;

    I've never had a problem with box characters. Must be user error
    I haven't used a compiler in ages, so please be gentle as I try to reacclimate myself. :P

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