Computer Science Canada

kbhit()

Author:  jonos [ Thu Mar 25, 2004 3:31 pm ]
Post subject:  kbhit()

well this is two questions:

what are the things called that you "include" (like #include<iostream>), is it called a library?

and the main questions: what "library" or whatever do i have to include in my program to get this to work, as i want to use it with a while loop.

thanks

time to sign my name:
jonos

Author:  wtd [ Thu Mar 25, 2004 4:48 pm ]
Post subject: 

Typically you're including a header file, which defines input and output of functions, and interfaces to classes, but not how they actually accomplish what they're doing.

More strictly, "libraries" are what we call the bits of code that answer that "how" question.

And the file you're looking for is conio.h.

code:
#include <conio.h>

int main()
{
   while (kbhit())
      // do something.
   return 0;
}


I would shy away from conio.h since it isn't part of ANSI standard C.

Author:  jonos [ Thu Apr 01, 2004 7:56 am ]
Post subject: 

is there another command or whatever not in conio that is kind of like that?


: