Design Pattern Examples
Overview of object-oriented design patterns
readkey.c
Go to the documentation of this file.
1
5
6#ifdef _MSC_VER
7#include <conio.h>
8#else
9#include <stdio.h>
10#endif
11
12#include "readkey.h"
13
14int readkey(void)
15{
16#ifdef _MSC_VER
17 int retval = _getch();
18 if (retval == 0)
19 {
20 retval = _getch();
21 }
22 return retval;
23#else
24 return getchar();
25#endif
26}
Declaration of the readkey() function, a blocking read for a key from the keyboard.
int readkey(void)
Read a key from the keyboard, blocking if no key is pressed. Use the checkforkey() function to see if...
Definition: readkey.c:14