You are here:

C++/C Graphics


Hello Sir,
I m from India.
Sir, I have gone through lines of program from internet and
I've got doubt in following lines :

Sir please tell me what is role of kbhit in graphics,
because I've came across it in many programs and some were
written in books by great authors but they didn't explained
its meaning. Is it only a variable kind of thing or it has
some specific function in grahics.

Thank You

Dear Paritosh Singh:

I did a search on kbhit c++ and this is what I came up with:

Prototype: int kbhit(void);
Header File: conio.h
Explanation: This function is not defined as part of the ANSI C/C++ standard. It is generally used by Borland's family of compilers. It returns a non-zero integer if a key is in the keyboard buffer. It will not wait for a key to be pressed.

So in the example above, it looks like it is waiting until a key is pressed then gets the character of the key that is pressed and breaks out of the loop.


All Answers

Answers by Expert:

Ask Experts


Titus B. Ledbetter, Jr.


C , MFC, Object Oriented, Artificial Intelligence


I have over ten years experience in the field of Computer Science, five years experience developing C/C++. I recently wrote a chess program using Object Oriented, C++, MFC.

Master's Degree Computer Science from Johns Hopkins

©2017 All rights reserved.