1

I wanted to use the conio.h header file in one of my C codes but as we know the header file is not available for Ubuntu, what should we do if we want to implement the functions if the header file conio.h, like getch() & getche() etc?

1 Answer 1

1

Check curses.h, available here is a C library for a terminal user interfaces (TUI).

conio.h was a C library for terminal user interfaces for MS-DOS systems not *nixes.

Here is a turorial for the curses library and here is the official manual

To get the curses.h header type: sudo apt-get install libncurses5-dev

4
  • If m including the header file curses.h the fatal error comes no such file or directory.. Jul 31, 2014 at 14:29
  • 1
    thnx @Stef;but now the problem arises, if I made an application using this header file and wanted to run it on another machine and that machine surely will not have the curses.h header file. And again the application wont work on it. Aug 1, 2014 at 16:02
  • 1
    You can compile and link statically against curses.h in order to produce a self contained executable but the best solution is to deploy your executable as a .deb package with dependencies. See here about how to package applications.
    – Stef K
    Aug 1, 2014 at 16:06
  • thnx @stef I'll let you know if there is more to ask in this.:) Aug 2, 2014 at 4:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .