We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you a podcast all about Citrix Workspace, moving to the cloud, and analytics & intelligence. Episode 2 coming soon!Listen Now

x

# conio.h for unix?

on
Medium Priority
946 Views
I was wondering, is there a library similar to the dos conio.h for unix?  I find myself needing some functions such as gotoxy, etc.
Comment
Watch Question

## View Solution Only

Commented:
You should look at functionalities provided by Curses:

curses.h (look in /usr/include)

Also 'man courses' should help.

Rgds, julio

Commented:
there is no man entry for "courses" or "curses"
Commented:
Curses typically runs on top of 'termcap'. Have a look at that
instead; but IMHO there was no good reason to reject Julio's
answer, because curses is the way to go (if you want portability
and ease of use) ...

kind regards,

Jos aka jos@and.nl

Not the solution you were looking for? Getting a personalized solution is easy.

Commented:
MAY BE YOU CAN USE THIS... (mnemonics)

void gotoxy(int int_Col, int int_Ren)
{
int int_e = 0,
int_i = 0,
int_ee = 0,
int_ii = 0;
/*  LIKE itoa() */
char str_b[4]="\0";
char str_c[4]="\0";
char str_Escape[] = "\033[";
int_e = int_Col /100;
int_Col = int_Col % 100;

if(int_e != 0){
str_c[int_i++] = int_e +48;
}

int_e = int_Col /10; int_Col = int_Col % 10;

if(int_e != 0){
str_c[int_i++] = int_e +48;
}

str_c[int_i] = int_Col + 48;
int_i = 0;

int_ee = int_Ren /100;
int_Ren = int_Ren % 100;

if(int_ee != 0){
str_b[int_ii++] = int_ee + 48;
}

int_ee = int_Ren /10; int_Ren = int_Ren % 10;

if (int_ee != 0){
str_b[int_ii++] = int_ee + 48;
}
str_b[int_ii] = int_Ren + 48;
int_ii = 0;

strcat(str_Escape,str_b);
strcat(str_Escape,";");
strcat(str_Escape,str_c);
strcat(str_Escape,"f");
printf(str_Escape); /* "\033<col>;<row>r" */

} /* end funcion gotoxy() */

/* CLEAR SCREEN */
void clrscr() { printf("\033[2J"); }
##### Thanks for using Experts Exchange.

• View three pieces of content (articles, solutions, posts, and videos)
• Ask the experts questions (counted toward content limit)
• Customize your dashboard and profile