Click here to Skip to main content
15,887,596 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
when am trying to run a sring related program in either c or c++ in ubuntu its not supporting and it does not supporting headerfiles..conio.h ...what do i do if i want to execute my program in ubuntu...is there any additional package to install..

What I have tried:

i tried by installing crusers.h package
Posted
Updated 20-Feb-17 21:13pm
v2
Comments
Peter_in_2780 21-Feb-17 2:42am    
From Wikipedia, "conio.h is a C header file used mostly by MS-DOS compilers to provide console input/output. It is not part of the C standard library or ISO C, nor is it defined by POSIX."
You need to avoid Microsoft proprietary code. Find alternatives to the bits that conio provides.

1 solution

As already mentioned conio.h is a compiler suite specific header file introduced by Turbo C for MS-DOS which has been later adapted also by Microsoft for their C compilers.

For similar functions on Linux you can use a curses library like Announcing ncurses 6.0 - GNU Project - Free Software Foundation (FSF)[^].

There is a project that implements conio.h using ncurses: Linux c++ implementation of conio.h download | SourceForge.net[^].

If you only need to read console input, use Ubuntu Manpage: fgetc, fgets, getc, getchar, gets, ungetc - input of characters and strings[^].

With C++ you can use also use Basic Input/Output - C++ Tutorials[^] which is supported by all compilers.
 
Share this answer
 
Comments
CPallini 21-Feb-17 3:49am    
5.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900