print text at any position without ncurses

Move your cursors to any position and print, it does the way just like how to change the color and attributes of the font illustrated at previous post.

Specified x and y position, and print a line “Hello World!”


//positioning
void gotoxy(int x, int y)
{
    printf("%c[%d;%df",0x1B,y,x);
}

int main()
{
       gotoxy(10,10);
       printf("Hello World\n");
       
       return 0;
}

3 thoughts on “print text at any position without ncurses

  1. Great
    U have write a good program for gotoxy.
    can u tell me the about that line
    printf(“%c[%d;%df”,0x1B,y,x);
    Plz
    i m eagerly waiting ur reply.

    Thanks Dear

  2. Pingback: writting a fun cli apps with ncurses

Leave a Reply

Your email address will not be published. Required fields are marked *