[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [G++ n00b] getche() in G++ ?
From: |
Paul Pluzhnikov |
Subject: |
Re: [G++ n00b] getche() in G++ ? |
Date: |
Thu, 01 Nov 2007 19:52:26 -0700 |
User-agent: |
Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Jumbo Shrimp, linux) |
Stefan Kristensen <stefan@jems.dk> writes:
> Hello boys and girls.
Some of us here are quite old :-(
> I'm refreshing my C++
For that, I recomment abandoning your old school book, and getting
excellent, modern and concise "Accelerated C++":
http://www.acceleratedcpp.com/
> My old school book has an example that uses getche(), which I
> understand is not C++ standard and is not supported by G++. Can anyone
> help me out and tell me what to use instead?
getchar() is close, but not exactly equivalent.
Reading keyboard *immediately* (without waiting for carriage return)
is rather tricky on UNIX.
> And while we are at it: The same question for clrscr() ;-)
That's also quite tricky, because there is no 'screen' that you
can clear. If you really want it, you can read about curses terminal
manipulation library. "man curs_clear" or "man wclear" may work.
Cheers,
--
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.