Solved

Cout and Bioskey functions in C++

Posted on 1998-05-06
3
382 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Problem in finding output of a program 11 101
C#, VS15, StructLayout 1 122
how to understand recursion 12 219
Can case within switch statement specify range of values ? 3 76
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
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…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use nested-loops in the C programming language.

861 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

24 Experts available now in Live!

Get 1:1 Help Now