kbhit Function - Computer Graphics CG Program

kbhit in computer graphics, below is the declaration of function.

Declaration : int kbhit();

kbhit() retruns int value. Returns 0 when key is pressed, else returns non-zero value.

Code:
#include <stdio.h>
#include <conio.h>

main()
{   while (!kbhit() == 0)
      printf("You haven't pressed a key.\n");
   return 0;
}

Post a Comment

0 Comments