I've been looking for the c keyboard input and can't find it.

A

academic

Hate to ask such a simple question but I've been looking through Help and
can't find what I need.

If I need to abort the app I print a message (fprintf) and return -1

Between those two I'd like to pause the app until user presses a key.

I've been looking for the c keyboard input and can't find it.

Just need to know user pressed any key.



Thanks
 
B

Bruno van Dooren

Hate to ask such a simple question but I've been looking through Help and
can't find what I need.

If I need to abort the app I print a message (fprintf) and return -1

Between those two I'd like to pause the app until user presses a key.

I've been looking for the c keyboard input and can't find it.

Just need to know user pressed any key.

there are a number of options. check MSDN for:

- getchar
- getc
- scanf

--

Kind regards,
Bruno.
(e-mail address removed)
Remove only "_nos_pam"
 
A

academic

I'll look them up.

Hope one doesn't require an Enter before it returns anything.


thanks
 
B

Bruno van Dooren

Hope one doesn't require an Enter before it returns anything.
In that case, you might want to use _getch. it is available in conio.h

it will return as soon as you press any key.

--

Kind regards,
Bruno.
(e-mail address removed)
Remove only "_nos_pam".
 
A

academic

I never would have found that.

thanks
Bruno van Dooren said:
In that case, you might want to use _getch. it is available in conio.h

it will return as soon as you press any key.

--

Kind regards,
Bruno.
(e-mail address removed)
Remove only "_nos_pam".
 
A

academic

works great
thanks again

Bruno van Dooren said:
In that case, you might want to use _getch. it is available in conio.h

it will return as soon as you press any key.

--

Kind regards,
Bruno.
(e-mail address removed)
Remove only "_nos_pam".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top