home *** CD-ROM | disk | FTP | other *** search
/ PC Extra Super CD 1998 January / PCPLUS131.iso / DJGPP / V2 / DJLSR201.ZIP / src / libc / ansi / stdio / freopen.txh < prev    next >
Encoding:
Text File  |  1995-07-10  |  561 b   |  27 lines

  1. @node freopen, stdio
  2. @subheading Syntax
  3.  
  4. @example
  5. #include <stdio.h>
  6.  
  7. FILE *freopen(const char *filename, const char *mode, FILE *file);
  8. @end example
  9.  
  10. @subheading Description
  11.  
  12. This function closes @var{file} if it was open, then opens a new
  13. file like @code{fopen(filename, mode)} but it reuses @var{file}.
  14.  
  15. This is useful to, for example, associate @code{stdout} with a new file. 
  16.  
  17. @subheading Return Value
  18.  
  19. The new file, or @code{NULL} on error. 
  20.  
  21. @subheading Example
  22.  
  23. @example
  24. freopen("/tmp/stdout.dat", "wb", stdout);
  25. @end example
  26.  
  27.