![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Hobbyist Programmer
Join Date: Jun 2005
Location: Helltown
Posts: 162
Rep Power: 4
![]() |
linux console input
ok... So I got my telecom project working. Project involves writing a c program for chat program...etc etc etc... Problem is that I did it in windows and the lab where I'm supposed to demonstrate my project doesn't have windows. So I start porting it to linux and get rid of all the compiler errors and it doesn't give any syntactical or contextual error. Then when its time to link, it says it cant find _kbhit and _getch which corresponds to the lines:
... if (_kbhit()){
c = _getch();
...Well, turns out they don't exist in the world of linux. I've declared some dummy functions with those names and tested, everything else works perfectly. Those 2 functions are the only things holding me back so I am serious need of linux equivalant of those functions. Could someone please help me out here. Thanks heaps.
__________________
Spread your wings and fly! Chicken! |
|
|
|
|
|
#2 |
|
Professional Programmer
Join Date: May 2006
Location: Maryland, USA
Posts: 306
Rep Power: 3
![]() |
You are using for asynchronous keyboard IO right? You can use select on the stdin file descriptor to accomplish the same thing. You can use a timeout of 0 to check for characters waiting on stdiin.
__________________
Robotics @ Maryland AUV Team - Software Lead |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Slackware installation guide for Linux beginners | coldDeath | Coder's Corner Lounge | 104 | Jul 29th, 2007 4:40 AM |
| My views on Linux | Marvin | Coder's Corner Lounge | 70 | Dec 19th, 2006 11:13 AM |
| Linux firewall. | BadBit | Coder's Corner Lounge | 7 | Nov 8th, 2005 1:36 AM |
| windows memset and Linux memset (difference?) | Dr.Backtick` | C++ | 0 | Feb 5th, 2005 7:59 PM |