Solved

Cout and Bioskey functions in C++

Posted on 1998-05-06
3
381 Views
Last Modified: 2006-11-17
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
0
Comment
Question by:tsar
3 Comments
 
LVL 11

Expert Comment

by:alexo
ID: 1249999
Post the code please
0
 
LVL 10

Expert Comment

by:RONSLOW
ID: 1250000
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
 
LVL 2

Accepted Solution

by:
kellyjj earned 200 total points
ID: 1250001
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

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
In desperate need of help 8 129
posix semaphore deadlock 13 108
Problem to ASCII 1 148
Socket Programming (Unix) 8 102
Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
The goal of this video is to provide viewers with basic examples to understand and use structures in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use switch statements in the C programming language.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now