www.digitalmars.com         C & C++   DMDScript  

c++ - g++ in UNIX: changing cursor position

reply "CY" <lcy hkem.com> writes:
How can I program to move the cursor to a specific position, change text
color or console background color, if I compile the code using g++ in UNIX,
just like doing so by including windows.h and use functions like
SetConsoleCursorPosition" and "SetConsoleTextAttribute" in VC++?

Thanks!
Feb 24 2002
parent Richard Johnson <rich REMOVETHISBITnorthernsky.uklinux.net> writes:
"CY" <lcy hkem.com> wrote in news:a5cocp$152o$1 digitaldaemon.com:

 How can I program to move the cursor to a specific position, change
 text color or console background color, if I compile the code using
 g++ in UNIX, just like doing so by including windows.h and use
 functions like SetConsoleCursorPosition" and "SetConsoleTextAttribute"
 in VC++? 
 
 Thanks!
 
 
 
You'll probably need to make use of the curses library which provides these sorts of functions under Unix. It's usually a case of including curses.h or ncurses.h - curses is the traditional library under unix, ncurses is a modern free clone of the curses library which you often get distributed with linux. Richard.
Feb 25 2002