you need curses
curses as in libcurses and curses.h that is
grep the web for curses examples
move(x,y) would be equivalent of gotoxy
gcc -lcurses ~/c/curseexample.c -o ~/c/curseexample
#include <curses.h>
main()
{
int x,y;
int f1,f2,f;
WINDOW *w;
w = initscr();
clear();
for (x=0;x<20;x++){
for (y=0;y<20;y++){
move(x,y);
addch('A'+x+y);
}
f = refresh();
}
f1 = move(10,10);
f2 = addstr("10,10");
f = printw("f is %d,%d\n",f1,f2);
f = refresh();
f = move(0,0);
f = addstr("0,0");
f = refresh();
// DO not use printf or other non-curses while doing curses!
// printf("HEYf is %d\n",f);
sleep(10);
endwin();
printf("non curses\n");
}
|