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

23 lines
311 B
C
Raw Normal View History

2023-07-14 12:50:17 +02:00
#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;
}