CODE:-
char ch,ch1;
ch=getchar();
ch1=getch();
printf("%c\n%c",ch,ch1);
When I enter a character during ch=getchar()
, I have to press enter key, which remains in input buffer.
That enter key is not read by the ch1=getch()
.
Why ch1=getch()
is not reading the remaining enter key?
contradictory to this fact
CODE 2:-
char ch,ch1;
ch=getch();
ch1=getch();
printf("%c\n%c",ch,ch1);
When I press a arrow key which produces two outputs, the first output is stored in ch
and the second output is stored in ch1
.