September 11th, 2013, 08:06 AM
What is the use of ungetch?
what is the use of ungetch?
How can i implement?
Is ungetch is predefined in somewhere?
September 11th, 2013, 09:37 AM
conio, yet again. It is not part of the standard, which means that it may or may not be supported by any given C compiler.
There are times when you want to be able to test what the next character in the input buffer is, but also want it to be the next one read after that test. ungetch undoes the get, meaning that it "puts the character back".
I just told you how to see if your gcc supports conio.
September 11th, 2013, 12:18 PM
BTW, the standard function is ungetc:
int ungetc (int, FILE*);
It works with any file, including the standard input file, stdin). And it is supported by every C compiler that complies to the standard.