Question for GCC programmers

Lisa Milne lisa at
Sat Oct 9 05:25:48 BST 2010

On Sat, 09 Oct 2010 14:26:31 +1100
David Bowskill <davidbow at> wrote:

> Thanks Lisa for your reply, my requirement I gather is not that
> unusual. Since you enlightened me on the concepts of  'raw' or
> 'cooked' terminals, I have found several other sources on this as
> follows:
> There are others as well. I wish to be able to compile the code to
> run under MSWindows (ugh!) for friends to use, so the solution must
> satisfy this. Thanks again for your invaluable help.
> Regards
> David Bowskill

Hi David,
I believe there are curses/ncurses libraries for windows as well as
Linux/Unix, so again that's one option.

However there is also windows conio.h header, which includes a getch()
and _getch() ( the latter being the reccomended one as the former is
deprecated ) which do what you want (I believe, I rarely code for
windows). In this case you'll need to use preprocessor directives to
ensure only the code for the target OS is compiled:

#ifdef _WIN32
	/* do windows specific code here */
	/* do Linux/Unix/Posix code here */

Lisa Milne <lisa at>

More information about the ubuntu-au mailing list