*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->IRIX man pages -> ungetc (3s)              
Title
Content
Arch
Section
 

Contents


UNGETC(3S)							    UNGETC(3S)


NAME    [Toc]    [Back]

     ungetc - push character back into input stream

SYNOPSIS    [Toc]    [Back]

     #include <stdio.h>

     int ungetc	(int c,	FILE *stream);

DESCRIPTION    [Toc]    [Back]

     ungetc inserts the	character c into the buffer associated with an input
     stream.  Pushed-back characters will be returned by subsequent reads on
     that stream in the	reverse	order of their pushing.	 A successful
     intervening call (with the	stream pointed to by stream) to	a file
     positioning function (fseek(3S), fsetpos(3S) or rewind(3S)), discards any
     pushed-back characters.  The external storage corresponding to the	stream
     is	unchanged.  A successful call to ungetc	clears the end-of-file
     indicator for the stream.

     One character of pushback is guaranteed, provided something has already
     been read from the	stream and the stream is actually buffered.

     If	c equals EOF, the operation fails and the input	stream is unchanged.

SEE ALSO    [Toc]    [Back]

      
      
     fseek(3S),	fsetpos(3S), getc(3S), rewind(3S), setbuf(3S), stdio(3S).

DIAGNOSTICS    [Toc]    [Back]

     ungetc returns the	character pushed back, or EOF if it cannot insert the
     character.

BUGS    [Toc]    [Back]

     When stream is stdin, one character may be	pushed back onto the buffer
     without a previous	read statement.

     An	ungetc on an unbuffered	stream (including stderr) may succeed, with
     the following consequences.  If the stream	is open	for input, the
     pushed-back character will	be prepended to	the input.  If the stream is
     open only for output, the next character written to the output stream may
     be	lost.


									PPPPaaaaggggeeee 1111
[ Back ]
 Similar pages
Name OS Title
ungetwc IRIX push wchar_t character back into input stream
ungetwc Tru64 Push a byte or wide-character code back into the input stream
ungetc Tru64 Push a byte or wide-character code back into the input stream
ungetwc Linux push back a wide character onto a FILE stream
wget_wch Tru64 Get (or push back) a wide character from Curses terminal keyboard
mvget_wch Tru64 Get (or push back) a wide character from Curses terminal keyboard
unget_wch Tru64 Get (or push back) a wide character from Curses terminal keyboard
mvwget_wch Tru64 Get (or push back) a wide character from Curses terminal keyboard
get_wch Tru64 Get (or push back) a wide character from Curses terminal keyboard
curs_get_wch Tru64 Get (or push back) a wide character from Curses terminal keyboard
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service