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.
char c;
c = getch();
if (c == 0)
c = getch();
#include <conio.h>
#define CTRL_Z 26
#define FRONT_ARROW 77
#define BACK_ARROW 75
#define DOWN_ARROW 80
#define UP_ARROW 72
void main()
{
int ch;
while(( ch = getch() ) != CTRL_Z ) // stops with CTRL-Z
{
switch(ch) {
case FRONT_ARROW:
cprintf("Front arrow.\r\n");
break;
case BACK_ARROW:
cprintf("Back arrow.\r\n");
break;
case DOWN_ARROW:
cprintf("Down arrow.\r\n");
break;
case UP_ARROW:
cprintf("Up arrow.\r\n");
break;
}//etc
}
}
#include <stdio.h>
#include <conio.h>
int main(int argc, char* argv[])
{
int ch;
printf ("Press q to quit\n");
do {
ch = _getch ();
if (ch == 0xE0 || ch == 0)
{
int second = _getch ();
printf ("%02x %02x\n", ch, second);
}
else
{
printf ("%02x\n", ch);
}
} while (ch != 'q');
return 0;
}
#include <conio.h>
#define CTRL_Z 26
void main()
{
int ch;
while(( ch = getch() ) != CTRL_Z ) // stops with CTRL-Z
{
cprintf(" character = %c ascii code = %d", ch, ch );
cprintf("\r\n");
}
}