Initial commit of lecture code

This commit is contained in:
Louise Brown
2022-04-07 16:58:01 +01:00
commit 5b205092a7
60 changed files with 2413 additions and 0 deletions

27
LC7/getch.c Normal file
View File

@@ -0,0 +1,27 @@
/*
Chapter 7: example of getch
This program reads a single keystroke and displays it
on the screen
*/
#include <stdio.h> /* Standard include files */
#include <stdlib.h>
#include <conio.h>
int main(void)
{
char x; /* Define a variable of type char */
x = getch(); /* Use getchar to read a keypress and store the */
/* result in 'x' */
putchar(x); /* Display the character stored in 'x' on the */
/* screen using putchar */
return 0;
}