Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
int c;
c = getch();
#include <conio.h>
#include <iostream.h>
int main()
{
char c, k; // characters for key presses
while (1)
{
// loop forever
c = getch(); // get a key press
if (!c)
{
// Some keys generate two bytes, the first is a NULL
k = getch(); // So we need to get more
cout << c << ", " << k << endl; // Show what we have, including NULL
}
else
{
// Otherwise we can just print the key code
cout << c << endl;
}
if (c=='q') break; // Lets get out of here
}