Solved

conio.h for unix?

Posted on 1997-08-10
4
871 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
deburging in oracle form 12 117
List out all word 7 350
sumDigits challenge 9 178
tripleUp challenge 7 95
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

738 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