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

This is a discussion on how do I move cursor to a certain spot on the screen (x,y) ? within the C Programming forums, part of the General Programming Boards category; 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, 01: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, 07:09 AM
  4. Using X,Y Coords in DOS Console
    By BigSter in forum C++ Programming
    Replies: 5
    Last Post: 12-11-2001, 07: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, 06:14 PM

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