AmigaActive (156/1728)

From:David McMinn
Date:4 Jun 2001 at 13:56:00
Subject:Re: Header Files (StormC v3)

--- In amigactive@y..., David Bateman <iklett@h...> wrote:
> > Isn't getch() in conio.h, i.e. it's Windows/DOS specific.
> > Can't help you with a replacement, I've been looking for some for
> > ages, but never found any.
>
> seems daft that us amiga users can't use this function, how do we
> accept character input with pressing the return key ?

It's not daft, it's linked to the way DOS (and DOS boxes) handles it's
keyboard input. Anyway, all it does is wait for a key to be pressed
and returns that.

If you are just waiting for a return, you could always use:

char buf[2];
scanf("%s", buf);

Althoguh I can't remember how to make scanf limit the number of
characters it puts in the buffer. I'm sure there's a better way to do
it than that, but my head hurts ATM, I need to drill it a bit to
relieve the pressure ;)

Quote carefully and read all ADMIN:README mails

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/