http://GameProgrammer.Com

Programming

GP Mailing List
     Thread Index
     Date Index

ATXGPSIG List
     Thread Index
     Date Index

Google
>

Home

Wise2Food



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: one-key input in C++



--- Sponsor's Message --------------------------------------
Discuss Tech News as It Happens!
Keep up with the latest happenings in high tech -- FREE!
http://click.topica.com/caaaa4IbUrGczbU68iFb/technology
------------------------------------------------------------

getch() is a good one.

Example:

main()
      {

             int c;

             printf("Would you like to continue? y/n");

             do
             {
                   c = getch();
             }while (c!=='n' && c!=='y')

      if (c == 'y')
            printf("Continue");
      else
            printf("quit");
}

Not sure what you have to include but I think it's <stdio.h>

The other, niftier, way is to use <bioskey.h> that way you can carry on doing
other
things while you wait for a key to be pressed.

- James
==^================================================================
EASY UNSUBSCRIBE click here: http://topica.com/u/?bUrGcz.bU68iF
Or send an email To: gameprogrammer-unsubscribe@topica.com
This email was sent to: list@pendleton.com

T O P I C A  -- Learn More. Surf Less.
Newsletters, Tips and Discussions on Topics You Choose.
http://www.topica.com/partner/tag01
==^================================================================