Solved

conio.h for unix?

Posted on 1997-08-10
4
865 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Decoding 32 bit binary streams 6 42
How to know only "File created" with EventLog 3 34
move a line in eclipse 3 100
twoTwo  challenge 35 101
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.

786 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