Thread: display at the center of the screen

  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    11

    display at the center of the screen

    Hello Everybody

    I would like to display my display at the center of the screen but i dun know which header file to use to make use of the

    gotoxy(x,y)

    Oh, if you can please give me some example

    Thank

  2. #2
    Registered User Vber's Avatar
    Join Date
    Nov 2002
    Posts
    807
    well, gotoxy you have in conio.h when we are talking about DOS. Now, if we're talking about Win32 console program, you can create
    Code:
    #include <windows.h> 
    
    void gotoxy(int x, int y)
    {
      COORD coord;
      coord.X = x;
      coord.Y = y;
      SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), coord);
    }
    About linux, ask in Linux programming.

  3. #3
    Registered User
    Join Date
    Mar 2003
    Posts
    11

    Unhappy Thank for replying so soon But Help!!

    Hi

    Thank for reply in so soon

    I want to try out how the program you post. But the cusor there got the x and y that i enter.

    Can you give mi a better example so that i can understand better

    And after each new line the cusor will go back to the left again, it will not print from the position i set


    Thank a lot
    Last edited by leinad079; 04-12-2003 at 01:07 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Linux Problem Screen Resoultion
    By Matus in forum Tech Board
    Replies: 1
    Last Post: 01-29-2009, 04:39 PM
  2. output display in screen required
    By imagetvr in forum C++ Programming
    Replies: 9
    Last Post: 08-19-2008, 09:55 PM
  3. Updating display on screen?
    By shadow1515 in forum C Programming
    Replies: 2
    Last Post: 06-06-2008, 10:24 AM
  4. Converting from Screen to World Coordinates
    By DavidP in forum Game Programming
    Replies: 9
    Last Post: 05-11-2004, 12:51 PM
  5. Output to screen display issues
    By spazjr01 in forum C++ Programming
    Replies: 3
    Last Post: 12-16-2002, 05:45 PM