how do i put my program inside a box or border

This is a discussion on how do i put my program inside a box or border within the C Programming forums, part of the General Programming Boards category; hello i am a complete novice programmer now i want to give my c program a nice look to do ...

  1. #1
    Registered User
    Join Date
    Jun 2012
    Posts
    1

    how do i put my program inside a box or border

    hello

    i am a complete novice programmer

    now i want to give my c program a nice look

    to do so i made a program like this


    Code:
    #include <stdio.h>
    main(void)
    {
        int i=1;
        printf("----------------------------------------------------------------------------------------------------------------------------------------------------------------");
        while(i<=20)
        {
            printf("
    ||                                                                          ||\n");
            i++;
        }
        printf("----------------------------------------------------------------------------------------------------------------------------------------------------------------");
        getch();
        return 0;
    }
    dont laugh this prints a box like this

    http://i1147.photobucket.com/albums/.../something.jpg

    http://i1147.photobucket.com/albums/.../something.jpg

    . but the problem is if i try to write something inside it the border collapses so i have to re arrange the order. now i have seen some c programs that actually has a border now how do i do that. i mean i there a logic to do so. please give answer in c language only. thanks in advance.

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,484
    FAQ > gotoxy() in a Windows Console - Cprogramming.com
    Normal console I/O treats everything as a stream.

    If you want detailed control, you need to start using functions specific to your OS. Which allow for example to treat your screen as an addressable grid.
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Executing a program inside a program in c++
    By neutron_star in forum C++ Programming
    Replies: 1
    Last Post: 06-11-2011, 07:57 AM
  2. Text and Forms inside a program.
    By bobbelPoP in forum Windows Programming
    Replies: 4
    Last Post: 08-11-2008, 02:12 AM
  3. Encryption program inside...
    By abh!shek in forum C Programming
    Replies: 18
    Last Post: 02-03-2008, 10:23 AM
  4. FAQ : running program inside program (spawn)
    By nipun in forum C Programming
    Replies: 3
    Last Post: 06-13-2004, 02:30 PM
  5. Starting independent exes from inside a c program
    By phil_drew in forum C Programming
    Replies: 5
    Last Post: 01-28-2003, 10:27 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21