Thread: drawing a box

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

    drawing a box

    Ok, this is the problem. I'm trying to draw a box. It's part of our assignment to draw a box so we can put stuff in it. It's just a plain on old box.

    so far I have:
    void main()
    {
    int box;
    cout << "\xF9";
    for (box = 2; box < 75; ++box) //for first corner on top

    cout << "\xF9";
    for (box = 2; box < 20; ++ box); // for line across the top

    cout << "\xF9"; // for second corner on top
    gotoxy(75,1);

    cout << "\xF9"; // this is where the problem is
    for (box = 74; box > 20; -- box);


    I can't get the line to go down the side. I'm about to pull my hair out.

    Please save me from being balder than i am.

    Thank you kindly,
    k

  2. #2
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    Read me
    and
    Read me too

    And for a non-looping way:
    Code:
    #include <iostream>
    
    const char box[] = 
      "+------+\n"
      "|      |\n"
      "|      |\n"
      "|      |\n"
      "+------+\n";
      
    int main()
    {
       std::cout <<box <<std::endl;
    }
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  3. #3
    Registered User
    Join Date
    Feb 2003
    Posts
    7

    drawing a box

    Thank you most kindly. I will give it a go!

  4. #4
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    Also, this recent thread had somethings you might want to use.
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  5. #5
    Registered User
    Join Date
    Feb 2003
    Posts
    7

    draw a box

    Yes that was kind of a help, even though it's not exactly what i'm looking for, I'm still working on the first one (crosses fingers).

    Again thanks, I do appreciate it.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 9
    Last Post: 02-13-2008, 02:59 PM
  2. How to program a "back" button with MFC
    By 99atlantic in forum Windows Programming
    Replies: 3
    Last Post: 04-26-2005, 08:34 PM
  3. How to type Unicode Box Drawing?
    By Jumper in forum Windows Programming
    Replies: 0
    Last Post: 07-14-2004, 12:18 PM
  4. New Theme
    By XSquared in forum A Brief History of Cprogramming.com
    Replies: 160
    Last Post: 04-01-2004, 08:00 PM
  5. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 09:44 AM