UNGETC.3
Upload User: jnzhq888
Upload Date: 2007-01-18
Package Size: 51694k
Code Size: 1k
Category:

OS Develop

Development Platform:

WINDOWS

  1. ." @(#)ungetc.3s 6.1 (Berkeley) 5/15/85
  2. ."
  3. .TH UNGETC 3  "May 15, 1985"
  4. .AT 3
  5. .SH NAME
  6. ungetc - push character back into input stream
  7. .SH SYNOPSIS
  8. .nf
  9. .ft B
  10. #include <stdio.h>
  11. int ungetc(int fIcfP, FILE *fIstreamfP)
  12. .ft R
  13. .fi
  14. .SH DESCRIPTION
  15. .B Ungetc
  16. pushes the character
  17. .I c
  18. back on an input stream.  That character will be returned by the next
  19. .B getc
  20. call on that stream.
  21. .B Ungetc 
  22. returns 
  23. .IR c .
  24. .PP
  25. One character of pushback is guaranteed provided
  26. something has been read from the stream and the stream is actually buffered.
  27. Attempts to push EOF are rejected.
  28. .PP
  29. .BR  Fseek (3)
  30. erases all memory of pushed back characters.
  31. .SH "SEE ALSO"
  32. .BR getc (3),
  33. .BR setbuf (3),
  34. .BR fseek (3).
  35. .SH DIAGNOSTICS
  36. .B Ungetc
  37. returns
  38. .SM
  39. .B EOF
  40. if it can't push a character back.