Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old May 30th, 2007, 11:22 PM   #1
rsnd
Hobbyist Programmer
 
rsnd's Avatar
 
Join Date: Jun 2005
Location: Helltown
Posts: 162
Rep Power: 4 rsnd is on a distinguished road
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!
rsnd is offline   Reply With Quote
Old May 31st, 2007, 1:48 AM   #2
Game_Ender
Professional Programmer
 
Game_Ender's Avatar
 
Join Date: May 2006
Location: Maryland, USA
Posts: 306
Rep Power: 3 Game_Ender is on a distinguished road
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
Game_Ender is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

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
Forum Jump

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




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 9:56 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC