Category : Miscellaneous Language Source Code
Archive   : CLC501.ZIP
Filename : GETCH.C

 
Output of file : GETCH.C contained in archive : CLC501.ZIP
/* .subt | Get and save character routines for desktop calculator */

#define BUFSIZE 100

char buf[BUFSIZE];
int bufp = 0;

getch()
{
return((bufp > 0) ? buf[--bufp] : getchar());
}

ungetch(c)
int c;
{
if (bufp > BUFSIZE)
printf("ungetch: too many characters\n");
else
buf[bufp++] = c
}

/* .subt < end of file, file getch.c */



  3 Responses to “Category : Miscellaneous Language Source Code
Archive   : CLC501.ZIP
Filename : GETCH.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/