Files
RedBear-OS/tests/getc_unget.c
T
2018-03-15 15:28:14 +08:00

13 lines
197 B
C

#include <stdio.h>
int main(int argc, char ** argv) {
ungetc('h', stdin);
char c;
if ((c = getchar()) == 'h') {
printf("Worked!\n");
return 0;
}
printf("failed :( %c\n", c);
return 0;
}