Solved

conio.h for unix?

Posted on 1997-08-10
4
864 Views
Last Modified: 2013-12-26
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.
0
Comment
Question by:Kased
4 Comments
 
LVL 5

Expert Comment

by:julio011597
ID: 1294223
You should look at functionalities provided by Curses:

curses.h (look in /usr/include)

Also 'man courses' should help.

Rgds, julio
0
 

Author Comment

by:Kased
ID: 1294224
there is no man entry for "courses" or "curses"
0
 
LVL 4

Accepted Solution

by:
jos010697 earned 20 total points
ID: 1294225
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
0
 

Expert Comment

by:navi_ivan
ID: 1294226
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"); }
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Include multiple hostnames in this command? 3 53
WinWaitActive parameters 12 31
ShiftLeft challenge 21 76
zeroMAx challenge 20 88
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now