Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
std::fflush(3)		      C++ Standard Libary		std::fflush(3)

NAME
       std::fflush - std::fflush

Synopsis
	  Defined in header <cstdio>
	  int fflush( std::FILE* stream	);

	  For  output streams (and for update streams on which the last	opera-
       tion was	output),
	  writes any unwritten data from the stream's buffer to	the associated
       output device.

	  For input streams (and for update streams on which the  last	opera-
       tion was	input),
	  the behavior is undefined.

	  If  stream  is  a null pointer, all open output streams are flushed,
       including the ones
	  manipulated within library packages or otherwise not directly	acces-
       sible to	the
	  program.

Parameters
	  stream - the file stream to write out

Return value
	  Returns zero on success. Otherwise EOF is returned and the error in-
       dicator of the
	  file stream is set.

Notes
	  POSIX	extends	the specification of fflush by defining	its effects on
       an input
	  stream, as long as that stream represents a file or another seekable
       device: in that
	  case the POSIX file pointer is repositioned to match	the  C	stream
       pointer (which
	  effectively  undoes  any  read  buffering)  and  the	effects	of any
       std::ungetc or
	  std::ungetwc that weren't yet	read back from	the  stream  are  dis-
       carded.

	  Microsoft  also  extends the specification of	fflush by defining its
       effects on an
	  input	stream:	in Visual Studio 2013 and prior, it discarded the  in-
       put buffer, in
	  Visual  Studio  2015	and  newer,  it	has no effect, buffers are re-
       tained.

See also
	  fopen	 opens a file
		 (function)
	  fclose closes	a file
		 (function)

http://cppreference.com		  2022.07.31			std::fflush(3)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=std::fflush&sektion=3&manpath=FreeBSD+Ports+15.0>

home | help