• C

Cout and Bioskey functions in C++

Hello, guys! I am trying to use Cout and Bioskey funcitons to work together to allow the uiser to hit a single key instead of a char-enter combination. However, for whatever reason the program awaits for the key before it displays a Cout message. Does anybody know what can be wrong?
Best regards,
Victor
tsarAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

alexoCommented:
Post the code please
0
RONSLOWCommented:
This is the 'C' topic area .. you should post this in the C++ area instead .. C experst may not even know what a Cout function is (cout is a predefined stream variable, not a function).

What OS and compiler are you using.  There is no standard Cout function (that I know of) and BiosKey certainly sounds OS dependant.

0
kellyjjCommented:
If you are using DOS,  then will get the job done for you.

      asm
      {
            mov ax,0;
            mov ah,0x10;
            int 16h;
            mov key_char,al;
            mov extn_char,ah;
      }

this will wait for a key to be pressed, w/o having to hit the enter key.   It returns the scan code or the extended scan code (if a function key was hit)  The scan code for normal keys (such as 'K') will return the ascii value.   Then all you have to do is use cout.   Hope this helps.

Kelly JJ
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.