Thread: Dos Graphic....kinda

  1. #1
    Registered User
    Join Date
    Sep 2004
    Posts
    38

    Dos Graphic....kinda

    if i wanted to create a program in console enviroment, and surround it with something simple like *, how would i go about that? All the turtorials I can find is based on windows stuff, i'm talking about good ole dos type. Even a point in the right direction would be helpful. Heres kinda what i mean.

    Code:
    *******************************
    *-----------------------------*
    *-----------------------------*
    *-----------------------------*
    *---------program-here--------*
    *-----------------------------*
    *-----------------------------*
    *-----------------------------*
    *-----------------------------*
    *******************************

  2. #2
    Registered User
    Join Date
    Jun 2004
    Posts
    52
    Do you mean you want your program to display that or you want your source code to look like that......?
    Last edited by Siggy; 10-13-2004 at 10:47 PM. Reason: grammar mistake

  3. #3
    Registered User
    Join Date
    Sep 2004
    Posts
    38
    the program

  4. #4
    Registered User
    Join Date
    Sep 2004
    Posts
    38
    I want my program to run after its compiled to run inside the *'s.

  5. #5
    Registered User
    Join Date
    Jun 2004
    Posts
    52
    example:
    you could do something like this although i am not sure this is what you mean.

    Code:
    cout << "********************" << endl;
    cout <<"*                                      *" << endl;
    cout <<"*      Put ur program        *" << endl;
    cout <<"*                here               *" << endl;
    cout <<"*                                      *" << endl;
    cout << "********************" << endl;
    again im not sure if this is what you mean but i tried......

    (edit)
    aaaah! it messed up the code o well u know what i mean.
    Last edited by Siggy; 10-13-2004 at 10:55 PM. Reason: grammar

  6. #6
    Registered User
    Join Date
    Sep 2004
    Posts
    38
    tried something similar, hmmm...maybe that will work, thanks. Sorry I couldn't better explain what I meant.

  7. #7
    Toaster Zach L.'s Avatar
    Join Date
    Aug 2001
    Posts
    2,686
    That'd work.
    Another suggestion which I'll put out there is to play around with <iomanip>, and the modifying the alignment, fill and width properties for cout so that it will (sort of) automatically do that stuff for you.

    I generally ignore the formatting of output streams (with the code I deal with, that stuff is usually long buried or somewhat irrelevant), so I can't be of much more help than to just point to the idea.
    The word rap as it applies to music is the result of a peculiar phonological rule which has stripped the word of its initial voiceless velar stop.

  8. #8
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Sounds like you need to create some kind of primitive window manager, where the *'s are drawn as the window border by the window manager.

    Perhaps http://en.tldp.org/HOWTO/NCURSES-Programming-HOWTO/
    There are win32 ports of ncurses
    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. DOS GUI or graphic programming using C
    By draggy in forum C Programming
    Replies: 8
    Last Post: 04-27-2006, 12:11 PM
  2. File systems?? (Winxp -> DOS)
    By Shadow in forum Tech Board
    Replies: 4
    Last Post: 01-06-2003, 09:08 PM
  3. Do you still need a graphic card if you're just using something like dos?
    By Nutshell in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 03-26-2002, 12:09 PM
  4. DOS graphic viewer
    By Unregistered in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 02-24-2002, 04:00 AM
  5. DOS program versus DOS console program
    By scromer in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 01-10-2002, 01:42 PM