Thread: how do I move cursor to a certain spot on the screen (x,y) ?

  1. #1
    Registered User
    Join Date
    Jun 2003
    Posts
    12

    how do I move cursor to a certain spot on the screen (x,y) ?

    how do I move cursor to a certain spot on the screen (x,y) ?

  2. #2
    Registered User
    Join Date
    May 2003
    Posts
    148
    Try this
    Code:
    void gotoxy(int x, int y) { printf("\033[%d;%dH", y, x); fflush(stdout); }

  3. #3
    Registered User
    Join Date
    Jun 2003
    Posts
    12
    this didn't work


    #include <stdio.h>
    int x = 20;
    int y = 20;
    void gotoxy( int x, int y);
    main()
    {
    gotoxy(x,y);
    }

    void gotoxy(int x, int y)
    { printf("\033[%d;%dH", y, x);
    fflush(stdout);
    printf("hi");
    }

  4. #4
    Registered User
    Join Date
    Jun 2003
    Posts
    12
    linux
    using gcc

  5. #5
    Registered User
    Join Date
    Jun 2003
    Posts
    12
    no idea what you are talking about.

  6. #6
    Registered User
    Join Date
    Jun 2003
    Posts
    12

    it did work

    It depended on terminal emulation but it did work for a vt100 terminal

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Allegro help-o
    By Vicious in forum Game Programming
    Replies: 109
    Last Post: 06-11-2002, 08:38 PM
  2. so if you want to move something around screen...
    By Unregistered in forum C++ Programming
    Replies: 3
    Last Post: 02-26-2002, 02:02 PM
  3. Green Pixel On My Screen???
    By (TNT) in forum A Brief History of Cprogramming.com
    Replies: 18
    Last Post: 01-21-2002, 08:09 AM
  4. Using X,Y Coords in DOS Console
    By BigSter in forum C++ Programming
    Replies: 5
    Last Post: 12-11-2001, 08:39 AM
  5. Shut off DOS screen automatically to Windows
    By Unregistered in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 11-08-2001, 07:14 PM