读书人

怎么把getchar()取出的字符放回缓冲区

发布时间: 2013-07-01 12:33:04 作者: rapoo

如何把getchar()取出的字符放回缓冲区呢???
如题,如何把getchar()取出的字符放回缓冲区呢???
[解决办法]
有个 ungetc 函数
[解决办法]
++

引用:
有个 ungetc 函数

[解决办法]
int ungetc(int c, FILE *stream)
ungetc pushes c (converted to an unsigned char) back onto stream, where it will be returned on the next read. Only one character of pushback per stream is guaranteed. EOF may not be pushed back. ungetc returns the character pushed back, or EOF for error.

读书人网 >C语言

热点推荐