exc/k&r/04-funcs-and-prog-struct/04-08.c

23 lines
311 B
C

#include <stdio.h>
int main()
{
;
}
/* this handles EOF as wall */
int buffc = -1;
char getch()
{
char temp;
return (buffc < 0) ? getchar() : (temp = buffc, buffc = -1, temp);
}
void ungetch(int c)
{
if (buffc >= 0)
printf("warning: overriding character buffer\n");
buffc = c;
}