Hi Holger. On Montag, 11. Juni 2007 13:40, Holger Wirtz wrote: > Hi, > > sorry, this posting is a litte bit OT, but I need a small chunk of code > for reading a key press (blocking) from standard input. I wan't to > code something like a PTT key. On every hit on the "blank"-key the mic > should be switched on and the speaker should be switched of until releasing > the key. I had some pieces of code written 10 years ago but I cannot find > them... and I won't read everything about termios again :-/
Have a look at http://www.o-schroeder.de/misc/read_key.c which is what you want, I think. But remember it works only for terminal applications. > Next question: how do I code in C something like hashed in Perl? > I have a list of frequencies and geographic coordinates of the > corresponding airport. I need to check every 10 seconds if my actual > position (of the plane) is in a specified range towards all positions > in this list. How should I store this list? There will be about 16000 items > in this list... I don't speak perl, but if I understand it right, something like C++ maps is what you're looking for. Have a look at http://www.cppreference.com/index.html and read about C++ Maps, C++ Multimaps and maybe C++ Lists. If you intend to use pure C, and not C++, I guess you have to implement such a datatype for yourself or download a librabry somewhere. Enjoy, Oliver ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel