nixCraft Linux Forum

nixCraft

Linux Tech Support Forum

conio.h

This is a discussion on conio.h within the Linux software forums, part of the Linux Getting Started category; In linux environment while using traditional c language, i got some problems b'coz conio.h was not there. is there any ...


Go Back   nixCraft Linux Forum > Linux Getting Started > Linux software

Register FAQ Members List Calendar Forgotten your password? Mark Forums Read
  #1 (permalink)  
Old 03-18-2005, 11:33 AM
Junior Member
User
 
Join Date: Feb 2005
Location: Punjab
Posts: 6
Rep Power: 0
Gopal
Default conio.h



In linux environment while using traditional c language, i got some problems b'coz conio.h was not there. is there any other header file that conducts with console designing. if yes, plz name it of if not then plz tell me how can i add this header file to my include directory in linux.
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 03-18-2005, 12:15 PM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
My distro: Ubuntu
Posts: 1,061
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

Ncurses is a library of functions that manage an application's display on character-cell terminals under Linux, FreeBSD etc. In order to use it with C under GCC you need ncurses-devel library installed. You need to include curses.h file instead of conio.h

In order to compile the code you need to include ncurses library by adding -lncurses to cc command as follows:
Code:
cc myprog.c -o myprog -lncurses
Example of program
Code:
#include <curses.h>
int main(void)
{

   /* initialize the curses library */
    initscr();      
    cbreak();       /* take input chars one at a time, no wait for \n */
    echo();         /* echo input - in color */
   
 /* now put rest of logic below */
   
       endwin();       /* must be called when done */
}
Read the man 3 ncurses for intro and supported list of functions.
__________________
Vivek | My personal blog
Linux Evangelist
Play hard stay cool
Reply With Quote
  #3 (permalink)  
Old 03-23-2005, 11:04 AM
Junior Member
User
 
Join Date: Feb 2005
Location: Punjab
Posts: 6
Rep Power: 0
Gopal
Default

Thanks Vivek
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT +5.5. The time now is 12:08 AM.


Powered by vBulletin® Version 3.7.4 - Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36