#include <ctype.h>
#include <stdio.h>
int main(void){
char ch = getch();
printf("%c", getch);
ungetch(ch);
ch = getch();
printf("%c", ch);
return 0;
}
$ gcc ./main.c
./main.c: In function ‘main’:
./main.c:5:12: warning: implicit declaration of function ‘getch’ [-Wimplicit-function-declaration]
char ch = getch();
^
./main.c:6:9: warning: format ‘%c’ expects argument of type ‘int’, but argument 2 has type ‘int (*)()’ [-Wformat=]
printf("%c", getch);
^
./main.c:7:2: warning: implicit declaration of function ‘ungetch’ [-Wimplicit-function-declaration]
ungetch(ch);
^
/tmp/ccGBsaa1.o: In function `main':
main.c:(.text+0xe): undefined reference to `getch'
main.c:(.text+0x16): undefined reference to `getch'
main.c:(.text+0x35): undefined reference to `ungetch'
main.c:(.text+0x3f): undefined reference to `getch'
collect2: error: ld returned 1 exit status