Mail Archives: djgpp/1994/08/30/21:00:46
> I'm preparing a C course, and am trying to get the stuff in the text
> to be as portable as possible, since the students have several compilers
> available.
> (1) I'm trying to compile a program out of a book that uses "getch".
getch() is not portable. Either don't use it (easiest) or else look
at the password code in ftp.uu.net:/pub/archiving/zip/zcrypt23.zip for
an example of how to do something similar "portably." (I use quotes
because it boils down to writing a separate routine for almost every
OS...) Unix has two or three different ways, depending on the version
(stty/gtty, termio, possibly termios).
> (2) Just for curiosity, where is getch, etc., in standard (Unix) gcc?
> The linker can't find it there either.
getch() is a DOSism.
Greg Roelofs
- Raw text -