#include <stdio.h> ret = ungetc( c, fp );
"ungetc" pushes a character back into an input stream. The next "getc" to that stream will return the character that was pushed back.
You can only push back characters into a stream if something has already been read from that stream and if the input from the stream is buffered. Trying to push back several characters in succession may or may not work; it will be highly machine dependent. You cannot push back more than three characters at a time with NS mode C.
"ungetc" will not attempt to push back the EOF character.
A side effect of the "fseek" function is that all memory of pushed back characters is lost.
expl nsc lib fseek
expl nsc lib getc
Copyright © 1996, Thinkage Ltd.