Solved

conio.h for unix?

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

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
Windows Drag & Drop Location 2 108
bobThere java chalenge 45 94
Best tools for Backup and restore of Wordpress site 6 57
FizzBuzz challenge 9 82
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
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.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

808 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